Skip to content

Commit 42da7d5

Browse files
committed
Make Browser return capabilities that can actually start a browser instance
1 parent 601e281 commit 42da7d5

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

java/client/test/org/openqa/selenium/testing/drivers/Browser.java

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,33 @@
4040

4141
public enum Browser {
4242
ALL(new ImmutableCapabilities(), "any", false),
43-
CHROME(new ChromeOptions(), new ChromeDriverInfo().getDisplayName(), true),
44-
EDGE(new EdgeOptions(), new EdgeDriverInfo().getDisplayName(), true),
43+
CHROME(new ChromeOptions(), new ChromeDriverInfo().getDisplayName(), true) {
44+
@Override
45+
public Capabilities getCapabilities() {
46+
String binary = System.getProperty("webdriver.chrome.binary");
47+
48+
return binary == null ? new ChromeOptions() : new ChromeOptions().setBinary(binary);
49+
}
50+
},
51+
EDGE(new EdgeOptions(), new EdgeDriverInfo().getDisplayName(), true) {
52+
@Override
53+
public Capabilities getCapabilities() {
54+
String binary = System.getProperty("webdriver.edge.binary");
55+
56+
return binary == null ? new EdgeOptions() : new EdgeOptions().setBinary(binary);
57+
}
58+
},
4559
HTMLUNIT(new ImmutableCapabilities(BROWSER_NAME, BrowserType.HTMLUNIT), "HtmlUnit", false),
4660
LEGACY_FIREFOX_XPI(new FirefoxOptions().setLegacy(true), new XpiDriverInfo().getDisplayName(), false),
4761
IE(new InternetExplorerOptions(), new InternetExplorerDriverInfo().getDisplayName(), false),
48-
FIREFOX(new FirefoxOptions(), new GeckoDriverInfo().getDisplayName(), false),
62+
FIREFOX(new FirefoxOptions(), new GeckoDriverInfo().getDisplayName(), false) {
63+
@Override
64+
public Capabilities getCapabilities() {
65+
String binary = System.getProperty("webdriver.firefox.bin");
66+
67+
return binary == null ? new FirefoxOptions() : new FirefoxOptions().setBinary(binary);
68+
}
69+
},
4970
LEGACY_OPERA(new OperaOptions(), new OperaDriverInfo().getDisplayName(), false),
5071
OPERA(new OperaOptions(), new OperaDriverInfo().getDisplayName(), false),
5172
SAFARI(new SafariOptions(), new SafariDriverInfo().getDisplayName(), false);

java/server/test/org/openqa/selenium/grid/router/StressTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,8 @@ public void tearDown() {
9595

9696
@Test
9797
public void multipleSimultaneousSessions() throws Exception {
98-
9998
assertThat(server.isStarted()).isTrue();
10099

101-
102100
CompletableFuture<?>[] futures = new CompletableFuture<?>[10];
103101
for (int i = 0; i < futures.length; i++) {
104102
CompletableFuture<Object> future = new CompletableFuture<>();

0 commit comments

Comments
 (0)