I am using python with Selenium WebDriver to test an angular based web-app.
In the login helper subroutine, on login, I want to check if it was successful before continuing with rest of the tests.
For this , I have the following piece of code:
login_success = WebDriverWait(self.driver,5).until(EC.visibility_of_element_located((By.CLASS_NAME,"hr-landing")))
if login_success:
self.logger.info("Looks like login was successful")
else:
login_errors = self.get_login_errors()
self.logger.debug(login_errors)
The problem I am facing is with the first line in the code. For a successful login, it returns quickly as the class 'hr-landing' is found.
However, for a failed login, that class is not found , and I wish for the Wait to timeout in 5 seconds as specified in my call to WebDriverWait.
However, the call times out only after 30 seconds (which is the implicit wait I have set on my driver)
How can I get around this issue ? I feel there is no point to providing the explicit timeout , because it is still respecting the implicit one.
Thanks a lot ! Moez.