java - Selenium 火狐无法启动

标签 java selenium firefox webdriver

使用 Firefox 的 Selenium Webdriver

System.setProperty("webdriver.firefox.marionette", "c:\\geckodriver-0.24.0-win64.exe");
WebDrier driver = new FirefoxDriver();
driver.get("http://localhost/index.html");

浏览器已打开,但无法加载页面。错误: 造成原因:

    org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:45855/hub/status] to be available after 45002 ms

        Caused by:
        java.util.concurrent.TimeoutException

最佳答案

如下更改第一行。

System.setProperty("webdriver.gecko.driver","c:\geckodriver-0.24.0-win64.exe");

关于java - Selenium 火狐无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55957023/

相关文章:

java - 均匀分割 xml 文件时遇到问题

angularjs - 将元素名称/ID 用于使用 Protractor 测试 AngularJS 的元素

java - 我们如何在 sendkeys 中传递对象引用的值

python - 使用 Selenium 在动态表中搜索字符串

java - IndexOutOfBounds 与索引 14,大小 16。如何?

java - 在 Java 中多次使用 "this"关键字

python - 更改 Firefox 首选项后,Selenium Firefox Webdriver 不会加载空白页面

html - div 在 firefox 中推出表格列的底部

java - Android 为什么所有的布局都是用字符串而不是枚举来完成

javascript - 在浏览器开发工具中停止网络请求