-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Closed
Labels
C-javaJava BindingsJava Bindings
Description
🚀 Feature Proposal
WebDriverWait currently has the following public constructors:
WebDriverWait(WebDriver driver, long timeOutInSeconds)WebDriverWait(WebDriver driver, long timeOutInSeconds, long sleepInMillis)WebDriverWait(WebDriver driver, java.time.Clock clock, Sleeper sleeper, long timeOutInSeconds, long sleepTimeOut)
The existing constructors should be deprecated (and removed?) in favor of java.time.Duration-based ones.
Motivation
The long parameters are worrisome. We've seen hundreds of "unit mismatch" bugs inside of Google when using a numeric primitive instead of a Duration.
Additionally, the existing constructors don't follow best practices w.r.t. parameter overloading (the ctors are effectively: init(A, B), init(A, B, C), init(A, D, E, B, C)).
Example
Assuming all of these ctor combinations are necessary, I'd suggest going with:
WebDriverWait(WebDriver driver, Duration timeOut)WebDriverWait(WebDriver driver, Duration timeOut, Duration sleep)WebDriverWait(WebDriver driver, Duration timeOut, Duration sleep, Clock clock, Sleeper sleeper)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-javaJava BindingsJava Bindings