I have a Clear Filter
button on my UI
that is removed after being clicked on.
My testcase is as follows:
1) Click the Clear Filter button
2) Check that the Clear Filter button has been removed from the UI
In the code below I am clicking the button and then I try to click it again, because it doesn't exist the test case should pass, but I am trying to verify the failure by attempting to click on it again, this doesn't seem like the best way to go about it...
log_page.clear_filter_bttnclick()
try:
if log_page.clear_filter_bttnclick():
testrailFunctions.failed()
except NoSuchElementException:
testrailFunctions.passed()
Can I use a try/except
here to verify the button is removed or is there a better way about going about confirming that the Clear Filter
button no longer exists on the UI
?
Cheers