SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.63k stars 8.18k forks source link

[🚀 Feature]: Add implicint wait, behind the scenes, when interacting with WebElements #13139

Closed harmin-parra closed 11 months ago

harmin-parra commented 11 months ago

Feature and motivation

Recent frameworks like Cypress and Playwright, make an implicit wait behind the scenes, when interacting with WebElements.

For this reason, Cypress and Playwright are very suitable for testing modern websites built with AngularJs and ReactJs

With Selenium, you need to write extra code to add the implicit wait.

Usage example

Writing this:

element = driver.find_element(By.ID, 'someid')

Instead of this:

from selenium.webdriver.support import expected_conditions as EC
wait = WebDriverWait(driver, 10)
element = wait.until(EC.presence_of_element_located((By.ID, 'someid')))
github-actions[bot] commented 11 months ago

@harmin-parra, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

titusfortner commented 11 months ago

Selenium does have the ability to do Implicit waiting — https://www.selenium.dev/documentation/webdriver/waits/#implicit-waits

Waiting is tricky because there is no single correct way to do it that works for every single use case (including how Playwright/Cypress does it). Many projects that wrap or extend Selenium have taken slightly different approaches.

github-actions[bot] commented 10 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.