Skip to content

Commit 4a919b7

Browse files
committed
Deprecating environment setting in FirefoxBinary, it should be configured in DriverService (for local runs) on in server/node settings (for remote runs)
1 parent 42fb125 commit 4a919b7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

java/client/src/org/openqa/selenium/firefox/FirefoxBinary.java

+18
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import static org.openqa.selenium.Platform.UNIX;
2525
import static org.openqa.selenium.Platform.WINDOWS;
2626
import static org.openqa.selenium.os.WindowsUtils.getPathsInProgramFiles;
27+
import org.openqa.selenium.remote.service.DriverService;
2728

2829
import com.google.common.collect.ImmutableList;
2930
import com.google.common.collect.Iterables;
@@ -138,6 +139,19 @@ public FirefoxBinary(File pathToFirefoxBinary) {
138139
executable = new Executable(pathToFirefoxBinary);
139140
}
140141

142+
/**
143+
* deprecated Use {@link DriverService.Builder#withEnvironment(Map)} instead:
144+
* <p>
145+
* new FirefoxDriver(
146+
* new GeckoDriverService.Builder()
147+
* .usingDriverExecutable(new File("path/to/geckodriver.exe"))
148+
* .usingFirefoxBinary(new FirefoxBinary(new File("path/to/firefox.exe")))
149+
* .withEnvironment(ImmutableMap.of("DISPLAY", "0:0"))
150+
* .build());
151+
* @param propertyName
152+
* @param value
153+
*/
154+
@Deprecated
141155
public void setEnvironmentProperty(String propertyName, String value) {
142156
if (propertyName == null || value == null) {
143157
throw new WebDriverException(
@@ -206,6 +220,10 @@ protected String getPath() {
206220
return executable.getPath();
207221
}
208222

223+
/**
224+
* @deprecated No replacement. Environment should be configured in {@link DriverService} instance.
225+
*/
226+
@Deprecated
209227
public Map<String, String> getExtraEnv() {
210228
return Collections.unmodifiableMap(extraEnv);
211229
}

0 commit comments

Comments
 (0)