how to set Firefox version in web-driver? I just want to user different version of Firefox.
like different version 19, 20 , 21....
please provide a generic solution which help for other browser also.
FireFox was fully supported only in previous versions i.e. v47 and earlier. Selenium WebDriver version 2.53 is not compatible with Mozilla FireFox version 47.0+. After v47. 0, FireFox is provided with GeckoDriver.
Next, go to https://firefox-source-docs.mozilla.org/testing/geckodriver/geckodriver/Support.html and check for required Firefox version supported by Selenium and Gecko driver: In my case, Selenium Webdriver version is 3.9. 1, so the supported Firefox browser is version 55+ and gecko driver supported is version 0.20. 1.
You have to install all the versions on your system. Then you can use the System property webdriver.firefox.bin
to define the path for Firefox. Note than since the path is set through a System property, you will not be able to run two different Firefox in the same Java process.
This solution is specific to Firefox. There is no generic solution. You have to configure every WebDriver yourself.
More information about the configuration of Firefox Web Drvier.
Finally i have found solution to run with different browser version
System.setProperty("webdriver.firefox.bin", "/Applications/Firefox-2.app/Contents/MacOS/firefox-bin");
WebDriver driver = new FirefoxDriver();
driver.get(baseUrl);
System.out.println(driver.getTitle());
driver.close();
driver.quit();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With