Fix WebDriverException when binary is set, but no firefox binary on the PATH.
The cause of the problem is to call the orElse method with new instance of FirefoxBinary as argument,
which requires Firefox binary in environment variable PATH.
@@ -215,7 +215,7 @@ public FirefoxOptions setBinary(String path) {
* useful when actually starting firefox.
*/
public FirefoxBinary getBinary() {
- return getBinaryOrNull().orElse(new FirefoxBinary());
+ return getBinaryOrNull().orElseGet(FirefoxBinary::new);
}
public Optional<FirefoxBinary> getBinaryOrNull() {
