public FirefoxBinary() { Executable systemBinary = locateFirefoxBinaryFromSystemProperty(); if (systemBinary != null) { executable = systemBinary; return; } Executable platformBinary = locateFirefoxBinariesFromPlatform().findFirst().orElse(null); if (platformBinary != null) { executable = platformBinary; return; } throw new WebDriverException("Cannot find firefox binary in PATH. " + "Make sure firefox is installed. OS appears to be: " + Platform.getCurrent()); }
public FirefoxBinary(Channel channel) { Executable systemBinary = locateFirefoxBinaryFromSystemProperty(); if (systemBinary != null) { if (systemBinary.getChannel() == channel) { executable = systemBinary; return; } else { throw new WebDriverException( "Firefox executable specified by system property " + FirefoxDriver.SystemProperty.BROWSER_BINARY + " does not belong to channel '" + channel + "', it appears to be '" + systemBinary.getChannel() + "'"); } } executable = locateFirefoxBinariesFromPlatform() .filter(e -> e.getChannel() == channel) .findFirst().orElseThrow(() -> new WebDriverException( String.format("Cannot find firefox binary for channel '%s' in PATH", channel))); }