Skip to content

Commit 7728f47

Browse files
committed
Looking for firefox executable in the directories where developer and nightly editions resides too.
1 parent dc80ee2 commit 7728f47

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

java/client/src/org/openqa/selenium/firefox/internal/Executable.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,11 @@ private static File locateFirefoxBinaryFromPlatform() {
121121

122122
Platform current = Platform.getCurrent();
123123
if (current.is(WINDOWS)) {
124-
binary =
125-
findExistingBinary(WindowsUtils.getPathsInProgramFiles("Mozilla Firefox\\firefox.exe"));
124+
ImmutableList.Builder<String> paths = new ImmutableList.Builder<>();
125+
paths.addAll(WindowsUtils.getPathsInProgramFiles("Mozilla Firefox\\firefox.exe"));
126+
paths.addAll(WindowsUtils.getPathsInProgramFiles("Firefox Developer Edition\\firefox.exe"));
127+
paths.addAll(WindowsUtils.getPathsInProgramFiles("Nightly\\firefox.exe"));
128+
binary = findExistingBinaries(paths.build()).stream().findFirst().orElse(null);
126129

127130
} else if (current.is(MAC)) {
128131
binary = new File("/Applications/Firefox.app/Contents/MacOS/firefox-bin");
@@ -151,13 +154,14 @@ private static File locateFirefoxBinaryFromPlatform() {
151154
return null;
152155
}
153156

154-
private static File findExistingBinary(final ImmutableList<String> paths) {
157+
private static ImmutableList<File> findExistingBinaries(final ImmutableList<String> paths) {
158+
ImmutableList.Builder<File> found = new ImmutableList.Builder<>();
155159
for (String path : paths) {
156160
File file = new File(path);
157161
if (file.exists()) {
158-
return file;
162+
found.add(file);
159163
}
160164
}
161-
return null;
165+
return found.build();
162166
}
163167
}

0 commit comments

Comments
 (0)