I am doing automation and making my code dynamic, in that way either element found or not, app should run smoothly and flawlessly. Right now, problem is there is an alert message which appears occasionally. let us say its A. It appears some time and some time not. Now I am using
A= driver.find_element_by_xpath("abc")
if A.isdisplay():
(whatevery my function is)
else:
(Do this)
but sometimes A does not appears, in that way script throws an exception and test got failed. Can someone please help me on this?