-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Open
Labels
A-needs-triagingA Selenium member will evaluate this soon!A Selenium member will evaluate this soon!B-supportIssue or PR related to support classesIssue or PR related to support classesC-dotnet.NET Bindings.NET BindingsI-enhancementSomething could be betterSomething could be better
Description
Feature and motivation
Often times, when using WebDriverWait
, we want to specify a custom sleep interval. However, it requires users to use the WebDriverWait(IClock clock, IWebDriver driver, TimeSpan timeout, TimeSpan sleepInterval)
constructor overload, and users must learn about the IClock
interface.
We can add a constructor WebDriverWait(IWebDriver driver, TimeSpan timeout, TimeSpan sleepInterval)
which allows users to specify only the values they need.
The Java binding already has this overload
selenium/java/src/org/openqa/selenium/support/ui/WebDriverWait.java
Lines 61 to 63 in d77c827
public WebDriverWait(WebDriver driver, Duration timeout, Duration sleep) { | |
this(driver, timeout, sleep, Clock.systemDefaultZone(), Sleeper.SYSTEM_SLEEPER); | |
} |
Usage example
var wait = new WebDriverWait(driver, timeout: TimeSpan.FromSeconds(15), sleepInterval: TimeSpan.FromSeconds(1));
IWebElement element = wait.Until(driver => driver.FindElement(By.Name("q")));
Metadata
Metadata
Assignees
Labels
A-needs-triagingA Selenium member will evaluate this soon!A Selenium member will evaluate this soon!B-supportIssue or PR related to support classesIssue or PR related to support classesC-dotnet.NET Bindings.NET BindingsI-enhancementSomething could be betterSomething could be better