[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)
@@ -351,7 +351,9 @@ default Timeouts implicitlyWait(Duration duration) {
* @return The amount of time the driver should wait when searching for an element.
* @see <a href="https://www.w3.org/TR/webdriver/#get-timeouts">W3C WebDriver</a>
*/
- Duration getImplicitWaitTimeout();
+ default Duration getImplicitWaitTimeout() {
+ throw new UnsupportedCommandException();
+ }
/**
* @deprecated Use {@link #setScriptTimeout(Duration)}
@@ -389,7 +391,9 @@ default Timeouts setScriptTimeout(Duration duration) {
* @return The amount of time to wait for an asynchronous script to finish execution.
* @see <a href="https://www.w3.org/TR/webdriver/#get-timeouts">W3C WebDriver</a>
*/
- Duration getScriptTimeout();
+ default Duration getScriptTimeout() {
+ throw new UnsupportedCommandException();
+ }
/**
* @deprecated Use {@link #pageLoadTimeout(Duration)}
@@ -422,7 +426,9 @@ default Timeouts pageLoadTimeout(Duration duration) {
* @return The amount of time to wait for a page load to complete.
* @see <a href="https://www.w3.org/TR/webdriver/#get-timeouts">W3C WebDriver</a>
*/
- Duration getPageLoadTimeout();
+ default Duration getPageLoadTimeout() {
+ throw new UnsupportedCommandException();
+ }
}
/**
