Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
I have a problem with Selenium Webdriver, trying to locate the element, the program gives an error "raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: Assertion failed"
My code is with a page-object model:
My code:
1st part -
def located_element(self, locator):
wait = WebDriverWait(self.driver, 30)
element = wait.until(EC.presence_of_element_located(locator))
return element
2nd part
def enter_email(self, user):
email_field = self.located_element(self.locator.Email)
email_field.click()
email_field.send_keys(Users.get_user(user)["email"])
3rd(running)
I have tried some recommendations from related issues but it didn't help me. At first, it couldn't find the element, that's why I added EC, but now it raises an error. Please, help me, how can I handle the Exception. I have tried the locator both with xpath and css-selector too.
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.