0

Geckodriver 0.35.0 does not seems to support the latest Firefox as I get the error message:

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line 

So I want to tell my Selenium automation to launch the previous version supported there (something from https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html). How can I do this?

1 Answer 1

0

Here you can find the previous versions of Firefox: https://ftp.mozilla.org/pub/firefox/releases/

You can install the installer or extract the zip/tarball.

Then you can indicate the binary with this code:

Python

geckodriver_path = "/path/to/geckodriver"

firefox_binary_path = "/path/to/firefox/binary"

options = Options()
options.binary_location = firefox_binary_path

service = Service(geckodriver_path)
driver = webdriver.Firefox(service=service, options=options)

Java:

System.setProperty("webdriver.gecko.driver", "/path/to/geckodriver");

FirefoxBinary firefoxBinary = new FirefoxBinary(new File("/path/to/firefox/binary"));

FirefoxOptions options = new FirefoxOptions();
options.setBinary(firefoxBinary);

WebDriver driver = new FirefoxDriver(options);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.