Skip to content

Commit

Permalink
[java] allow ignoring chromedriver build checks using service builders
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Dec 10, 2022
1 parent 3e146d0 commit 18beade
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 12 additions & 1 deletion java/src/org/openqa/selenium/chrome/ChromeDriverService.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public static ChromeDriverService createServiceWithConfig(ChromeOptions options)
public static class Builder extends DriverService.Builder<
ChromeDriverService, ChromeDriverService.Builder> {

private final boolean disableBuildCheck = Boolean.getBoolean(CHROME_DRIVER_DISABLE_BUILD_CHECK);
private boolean disableBuildCheck = Boolean.getBoolean(CHROME_DRIVER_DISABLE_BUILD_CHECK);
private boolean appendLog = Boolean.getBoolean(CHROME_DRIVER_APPEND_LOG_PROPERTY);
private boolean verbose = Boolean.getBoolean(CHROME_DRIVER_VERBOSE_LOG_PROPERTY);
private boolean silent = Boolean.getBoolean(CHROME_DRIVER_SILENT_OUTPUT_PROPERTY);
Expand Down Expand Up @@ -187,6 +187,17 @@ public Builder withAppendLog(boolean appendLog) {
return this;
}

/**
* Allows the driver to be used with potentially incompatible versions of the browser.
*
* @param noBuildCheck True for not enforcing matching versions.
* @return A self reference.
*/
public Builder withBuildCheckDisabled(boolean noBuildCheck) {
this.disableBuildCheck = noBuildCheck;
return this;
}

/**
* Configures the driver server verbosity.
*
Expand Down
13 changes: 12 additions & 1 deletion java/src/org/openqa/selenium/edge/EdgeDriverService.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static EdgeDriverService createDefaultService() {
public static class Builder extends DriverService.Builder<
EdgeDriverService, Builder> {

private final boolean disableBuildCheck = Boolean.getBoolean(EDGE_DRIVER_DISABLE_BUILD_CHECK);
private boolean disableBuildCheck = Boolean.getBoolean(EDGE_DRIVER_DISABLE_BUILD_CHECK);
private boolean appendLog = Boolean.getBoolean(EDGE_DRIVER_APPEND_LOG_PROPERTY);
private boolean verbose = Boolean.getBoolean(EDGE_DRIVER_VERBOSE_LOG_PROPERTY);
private String logLevel = System.getProperty(EDGE_DRIVER_LOG_LEVEL_PROPERTY);
Expand Down Expand Up @@ -161,6 +161,17 @@ public Builder withAppendLog(boolean appendLog) {
return this;
}

/**
* Allows the driver to be used with potentially incompatible versions of the browser.
*
* @param noBuildCheck True for not enforcing matching versions.
* @return A self reference.
*/
public Builder withBuildCheckDisabled(boolean noBuildCheck) {
this.disableBuildCheck = noBuildCheck;
return this;
}

/**
* Configures the driver server verbosity.
*
Expand Down

0 comments on commit 18beade

Please sign in to comment.