Skip to content

Commit 1cad0ca

Browse files
committed
[java] Removing deprecated implicitlyWait timeout
1 parent fcf4c9d commit 1cad0ca

File tree

3 files changed

+2
-30
lines changed

3 files changed

+2
-30
lines changed

java/src/org/openqa/selenium/WebDriver.java

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -295,26 +295,6 @@ interface Options {
295295
*/
296296
interface Timeouts {
297297

298-
/**
299-
* @deprecated Use {@link #implicitlyWait(Duration)}
300-
* <p>Specifies the amount of time the driver should wait when searching for an element if
301-
* it is not immediately present.
302-
* <p>When searching for a single element, the driver should poll the page until the element
303-
* has been found, or this timeout expires before throwing a {@link NoSuchElementException}.
304-
* When searching for multiple elements, the driver should poll the page until at least one
305-
* element has been found or this timeout has expired.
306-
* <p>Increasing the implicit wait timeout should be used judiciously as it will have an
307-
* adverse effect on test run time, especially when used with slower location strategies
308-
* like XPath.
309-
* <p>If the timeout is negative, not null, or greater than 2e16 - 1, an error code with
310-
* invalid argument will be returned.
311-
* @param time The amount of time to wait.
312-
* @param unit The unit of measure for {@code time}.
313-
* @return A self reference.
314-
*/
315-
@Deprecated
316-
Timeouts implicitlyWait(long time, TimeUnit unit);
317-
318298
/**
319299
* Specifies the amount of time the driver should wait when searching for an element if it is
320300
* not immediately present.
@@ -333,9 +313,7 @@ interface Timeouts {
333313
* @param duration The duration to wait.
334314
* @return A self reference.
335315
*/
336-
default Timeouts implicitlyWait(Duration duration) {
337-
return implicitlyWait(duration.toMillis(), TimeUnit.MILLISECONDS);
338-
}
316+
Timeouts implicitlyWait(Duration duration);
339317

340318
/**
341319
* Gets the amount of time the driver should wait when searching for an element if it is not

java/src/org/openqa/selenium/remote/RemoteWebDriver.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -955,12 +955,6 @@ public Window window() {
955955

956956
protected class RemoteTimeouts implements Timeouts {
957957

958-
@Deprecated
959-
@Override
960-
public Timeouts implicitlyWait(long time, TimeUnit unit) {
961-
return implicitlyWait(Duration.ofMillis(unit.toMillis(time)));
962-
}
963-
964958
@Override
965959
public Timeouts implicitlyWait(Duration duration) {
966960
execute(DriverCommand.SET_IMPLICIT_WAIT_TIMEOUT(duration));

java/test/org/openqa/selenium/support/decorators/DecoratedTimeoutsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private void verifyFunction(Consumer<WebDriver.Timeouts> f) {
6161

6262
@Test
6363
void implicitlyWaitLegacy() {
64-
verifyFunction($ -> $.implicitlyWait(10, TimeUnit.SECONDS));
64+
verifyFunction($ -> $.implicitlyWait(Duration.ofSeconds(10)));
6565
}
6666

6767
@Test

0 commit comments

Comments
 (0)