Travis使用Firefox 56,尽管Firefox 59安装在同一系统上 [英] Travis uses Firefox 56 although Firefox 59 is installed on same system
问题描述
在Travis上运行Selenium时,它使用Firefox版本56.我需要使用最新版本的Firefox59.运行 apt-get update
和 upgrade
不会解决了这个问题,但是让系统使用了两个不同版本的Firefox,分别是56和59.
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
但是
$ /usr/bin/firefox --version
Mozilla Firefox 59.0.2
任何人都知道如何解决此问题,以便Firefox 59是系统上唯一可用的版本吗?
Anyone knows how to resolve this so that Firefox 59 is the only version available on the system?
一个临时修复方法可能是将56个bin文件与59个bin文件一起复制.
One temporary fix could be just to copy over the 56 bin file with the 59 one.
推荐答案
Java观点
即使您多次安装了不同版本的 Firefox Binary ,您仍然可以通过 FirefoxOptions() 测试执行期间的类,如下所示:
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();
这篇关于Travis使用Firefox 56,尽管Firefox 59安装在同一系统上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!