I want to check if a text(hyperlink) is present or not in the page. If displayed I was click on it. And if not sleep for 5 more seconds.
I've tried
if driver.find_element_by_id('xpath').is_displayed:
driver.find_element_by_id('xpath').click()
else:
time.sleep(2)
However I'm not able to get it to work.