45000之后无法在端口7055上连接到主机127.0.0.1

在我的eclipse中运行代码(Selenium webdriver / java);但它显示错误45000 ms后无法连接到端口7055上的主机127.0.0.1 . Firefox控制台输出“.... screenshot of code and error

回答(1)

2 years ago

听起来像你使用的Selenium版本isn 't compatible with the version of Firefox you are testing. Make sure that you have the latest version of Selenium if you'重新测试最新的Firefox版本,并相应地设置webdriver.gecko.driver系统属性:

System.setProperty("webdriver.gecko.driver", "c:\\tools\\webdriver\\geckodriver.exe");
driver = new FirefoxDriver();

有关详细信息,请参阅Mozilla文档:https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette