I'm running a test case and part of it is to check if an element in an iframe
is visible
I have done the below but it's not working and always goes to the except block. Thank you
try:
time.sleep(2)
driver.switch_to.frame("iframe-xxxxxxxxxxxxxxxxxx")
time.sleep(2)
if driver.find_element_by_xpath("//div[@class='col-11 answer-feedback-label']//div[contains(text(),'Hello World!')]"):
logging.info("Success")
except:
logging.error("Failure")