相关疑难解决方法(0)

如何更改Webdriver Firefox连接到localhost的端口?

我有一个selenium webdriver测试,转换为maven项目,我想通过Jenkins上的xvfb运行.

显示选择存在问题,但我想尝试其他方法并更改端口,例如.

这是我得到的错误:

org.openqa.selenium.firefox.NotConnectedException:无法连接后45000毫秒到主机端口7055 127.0.0.1.

Firefox控制台输出:

错误:未指定显示

错误:未指定显示

这是我的代码:

File ffExe = new File("/usr/bin/firefox");
FirefoxBinary ffox = new FirefoxBinary(ffExe);
ffox.setEnvironmentProperty("DISPLAY", ":21");
WebDriver driver = new FirefoxDriver(ffox, null);
Run Code Online (Sandbox Code Playgroud)

那么,我如何告诉firefox使用另一个端口以及我应该指定哪个端口?

firefox selenium webdriver

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

firefox ×1

selenium ×1

webdriver ×1