For my iOS Automation,
I wanted to check if an element is present. more like a wait command.
So its like -
html_source = wd.page_source
if element not in html_source:
WebDriverWait(wd, 20).until(EC.presence_of_element_located((By.NAME, element)))
print " error in locating element"
But whenever i try running this to find an element not present, It waits for 20 seconds and quits, It never prints the error message . So what should i need to do to print the error message, if the element is not found?
Any help ?