使用Selenium 3.1.0,firefox最新版本72.0,默认firefox驱动程序2.53.1,这是我的代码
System.setProperty("webdriver.gecko.driver" ,"C:\\Users\\sindhusha.tummala\\Downloads\\geckodriver.exe");
driver = new FirefoxDriver();不过,我还是搞错了
org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files\Mozilla Firefox\firefox.exe) on port 7055; 有人能帮上忙吗
发布于 2020-01-13 06:57:10
这个错误信息..。
org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files\Mozilla Firefox\firefox.exe) on port 7055; ...implies表示GeckoDriver二进制文件(可执行文件)无法启动/生成新的浏览上下文,即Firefox浏览器会话,因为它无法找到FirefoxBinary。
当Firefox没有安装在默认位置或根本没有安装时,就会出现此问题。
解决方案
为解决这一问题:
firefox_binary传递Firefox二进制的绝对路径,如下所示:附加考虑
确保:
Test。tearDown(){}方法中调用tearDown(){}来关闭和销毁WebDriver和WebDriver实例。欧特罗
您可以在以下几个方面找到相关的讨论:
https://stackoverflow.com/questions/59709978
复制相似问题