Travis uses Firefox 56 although Firefox 59 is installed on same system

ぐ巨炮叔叔 提交于 2021-02-10 18:00:18

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!