这个问题在这里已有答案:
当我运行selenium webdriver程序时,我收到一个名为“org.openqa.selenium.firefox.NotConnectedException的错误:无法在45000 ms后连接到端口7055上的主机127.0.0.1.Firefox控制台输出” .
这是什么错误..?
你有skype,teamviewer?您必须禁用它或卸载它,因为其他应用程序使用您使用的服务器的端口 . 我的意思是您的服务器使用的端口已被其他应用程序使用..
你可以尝试一次:
根据要求从here下载gecko驱动程序 .
然后在主方法下在Selenium中编写代码:
System.setProperty("webdriver.gecko.driver", "path you downloaded/geckodriver.exe"); DesiredCapabilities capabilities = DesiredCapabilities.firefox(); capabilities.setCapability("marionette", true); WebDriver driver = new FirefoxDriver(capabilities); driver.get("www.google.com");
我认为这可能对您有所帮助,因为Firefox的更新版本存在问题 .
2 回答
你有skype,teamviewer?您必须禁用它或卸载它,因为其他应用程序使用您使用的服务器的端口 . 我的意思是您的服务器使用的端口已被其他应用程序使用..
你可以尝试一次:
根据要求从here下载gecko驱动程序 .
然后在主方法下在Selenium中编写代码:
我认为这可能对您有所帮助,因为Firefox的更新版本存在问题 .