I want to check if an element is visible/present/detected by Selenium Web Driver for the following XPath:
//*[@data-animate-modal-popup="true"]
Is there any Selenium's function that returns TRUE or FALSE whenever that element is visible/present/detected?
Last time I was using the following IF - Else
phone_number_invalid = driver.find_element_by_xpath('//*[@data-animate-modal-popup="true"]')
if phone_number_invalid:
code here .....
That find_element_by_xpath
always throws an error whenever it doesn't find the element. I want to only get TRUE or FALSE whenever the element is visible/present/detected.
Thank you.