使用最新的 Selenium WebDriver v 2.50.00,我(再次)遇到以下异常:
Failed to start up socket within 45000 ms. Attempted to connect to the following addresses: 127.0.0.1:7055
执行:
driver = new FirefoxDriver(new FirefoxBinary(), firefoxProfile, pageLoadTimeout);
Firefox 43 及更高版本会发生这种情况。我已将 Firefox 降级至 v.39,并且运行正常。
这个问题似乎在不同版本的 Selenium 和 Firefox 中发生过几次,请参阅 here或here .
对此有任何解决方法或降级 Firefox 并等待新版本的 Selenium WebDriver 是唯一的方法吗?
最佳答案
是的,这是一个错误,最新版本仍将解决
您需要将首选项设置为 xpinstall.signatures.required", false
。
下面的代码对我有用,但它是用java编写的。你知道哪里需要改变
WebDriver driver = null;
final FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.setPreference("xpinstall.signatures.required", false);
driver = new FirefoxDriver(firefoxProfile);
driver.manage().window().maximize();
driver.get("https://www.google.co.in/");
希望对你有帮助:)
关于c# - 使用 Firefox 43 及更高版本创建新的 FirefoxDriver 再次超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35055498/