【问题标题】:[karate]: Karate UI Automation: Unable to launch the browser[空手道]:空手道 UI 自动化:无法启动浏览器
【发布时间】:2021-12-10 13:35:12
【问题描述】:

编译器正在寻找 chrome.exe 文件的目标文件夹。它正在其中寻找一些 chrome_1639142447236 文件。实际上它可以在C:\Program Files (x86)\Google\Chrome\Application这个位置找到。 我收到以下错误消息:

18:51:39.096 [ForkJoinPool-1-worker-3] 错误 com.intuit.karate - org.apache.http.conn.HttpHostConnectException:连接到 localhost:9222 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] 失败:连接被拒绝:没有更多信息,http调用失败 URL 4022 毫秒后:http://localhost:9222 18:51:39.098 [ForkJoinPool-1-worker-3] 错误 com.intuit.karate - http 请求 失败:

以下是功能级别错误消息:

失败的功能:src.test.java.examples.users.Sample:Sample.feature:9

  • 驱动程序配置/启动失败:org.apache.http.conn.HttpHostConnectException:连接到 localhost:9222 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] 失败:连接被拒绝:没有更多信息,选项: {type=chrome, target=null}

【问题讨论】:

    标签: karate


    【解决方案1】:

    如果您知道 chrome 可执行文件在哪里,请按照说明在您的空手道测试中自定义它:https://github.com/karatelabs/karate/tree/master/karate-core#configure-driver

    * configure driver = { type: 'chrome', executable: 'chrome' }
    

    还请阅读此答案了解更多详情:https://stackoverflow.com/a/66762430/143475

    【讨论】:

    • 尝试了上面的解决方案,它有效。我能够启动浏览器。但它不是执行场景。浏览器只是打开几秒钟然后关闭。显示以下错误消息。驱动程序配置/启动失败:chrome 服务器从 localhost:9222 返回空列表,选项:{executable=C:\Program Files\Google\Chrome\Application\chrome.exe, target=null, type=chrome} 我在这里遗漏了什么
    • 不知道。 ui自动化并不容易,所以一切顺利
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-22
    • 1970-01-01
    • 1970-01-01
    • 2020-09-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多