问题
When running Selenium on Travis, it uses Firefox version 56. I need to use the latest version of Firefox, 59. Running apt-get update
and upgrade
does not solve this problem, but instead leaves the system with two different versions of Firefox, both 56 and 59.
$ which firefox
/usr/local/bin/firefox
$ firefox --version
Mozilla Firefox 56.0.2
but
$ /usr/bin/firefox --version
Mozilla Firefox 59.0.2
Anyone knows how to resolve this so that Firefox 59 is the only version available on the system?
One temporary fix could be just to copy over the 56 bin file with the 59 one.
回答1:
Java perspective
Even though you are having multiple installations of different versions of Firefox Binary you can still pick up your choice of the desired Firefox Binary version through the setBinary() option of FirefoxOptions() Class during your test execution as follows :
System.setProperty("god.bless.us", "C:/Utility/BrowserDrivers/geckodriver.exe");
FirefoxOptions options = new FirefoxOptions();
options.setBinary("C:\\Program Files\\Mozilla Firefox\\firefox.exe");
WebDriver driver = new FirefoxDriver(options);
driver.get("https://stackoverflow.com");
System.out.println("Page Title is : "+driver.getTitle());
driver.quit();
来源:https://stackoverflow.com/questions/49918282/travis-uses-firefox-56-although-firefox-59-is-installed-on-same-system