Skip to content

Commit 0d3c330

Browse files
committed
[java] Adding default implementation for the methods recently added to the interface WebDriver to prevent compilation errors in third-party classes implementing WebDriver (e.g. HtmlUnitDriver)
1 parent 0eb85c7 commit 0d3c330

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,9 @@ default Timeouts implicitlyWait(Duration duration) {
351351
* @return The amount of time the driver should wait when searching for an element.
352352
* @see <a href="https://www.w3.org/TR/webdriver/#get-timeouts">W3C WebDriver</a>
353353
*/
354-
Duration getImplicitWaitTimeout();
354+
default Duration getImplicitWaitTimeout() {
355+
throw new UnsupportedCommandException();
356+
}
355357

356358
/**
357359
* @deprecated Use {@link #setScriptTimeout(Duration)}
@@ -389,7 +391,9 @@ default Timeouts setScriptTimeout(Duration duration) {
389391
* @return The amount of time to wait for an asynchronous script to finish execution.
390392
* @see <a href="https://www.w3.org/TR/webdriver/#get-timeouts">W3C WebDriver</a>
391393
*/
392-
Duration getScriptTimeout();
394+
default Duration getScriptTimeout() {
395+
throw new UnsupportedCommandException();
396+
}
393397

394398
/**
395399
* @deprecated Use {@link #pageLoadTimeout(Duration)}
@@ -422,7 +426,9 @@ default Timeouts pageLoadTimeout(Duration duration) {
422426
* @return The amount of time to wait for a page load to complete.
423427
* @see <a href="https://www.w3.org/TR/webdriver/#get-timeouts">W3C WebDriver</a>
424428
*/
425-
Duration getPageLoadTimeout();
429+
default Duration getPageLoadTimeout() {
430+
throw new UnsupportedCommandException();
431+
}
426432
}
427433

428434
/**

0 commit comments

Comments
 (0)