【问题标题】:How to solve errors from running jobs in parallel using Jenkins and watir webdriver?如何解决使用 Jenkins 和 watir webdriver 并行运行作业的错误?
【发布时间】:2013-04-12 10:41:22
【问题描述】:

我正在 Windows 上从 Jenkins 运行测试,当多个作业同时在不同的构建线程上运行时,当一次只执行一个时,测试工作正常。我正在使用 Watir 网络驱动程序。浏览器的创建使用代码:

profile = Selenium::WebDriver::Chrome::Profile.new
browser = Watir::Browser.new :chrome, :profile => profile, :http_client=>client

测试是用 Ruby 和 Cucumber 编写的,我使用标签在每个作业中运行测试的子集。测试是使用“执行 Windows 批处理命令”中的黄瓜执行的。在我的桌面上打开两个命令行实例并并行运行作业可以正常工作。

似乎会再次出现几个不同的错误。一种是:

[0412/111507:ERROR:ipc_sync_channel.cc(378)] Canceling pending sends
[0412/111552:ERROR:proxy_launcher.cc(114)] WaitForInitialLoads failed.
[0412/111552:ERROR:proxy_launcher.cc(556)] Failed to ConnectToRunningBrowser
[0412/111552:ERROR:automation_proxy.cc(319)] Channel error in AutomationProxy.
[0412/111552:ERROR:ipc_sync_channel.cc(378)] Canceling pending sends
[0412/111552:ERROR:ipc_sync_channel.cc(378)] Canceling pending sends
Unable to either launch or connect to Chrome. Please check that ChromeDriver is up-to-date. Using Chrome binary at: C:\Users\steve\AppData\Local\Google\Chrome\Application\chrome.exe (Selenium::WebDriver::Error::UnknownError)

另一个是

No connection could be made because the target machine actively refused it. - connect(2) (Errno::ECONNREFUSED)

在我的桌面上通过命令行而不是通过 Jenkins 运行的示例是:

cucumber --tags @event_discounts ENVIRONMENT=beta

cucumber --tags @WhiteList ENVIRONMENT=BETA

关于如何解决这个问题的任何建议?

【问题讨论】:

  • 您如何并行运行测试(代码示例)?它是否适用于其他浏览器,例如 Firefox?
  • 啊哈,在测试您的建议时找到了解决方案。我会发布作为答案。

标签: ruby jenkins watir-webdriver selenium-chromedriver


【解决方案1】:

解决方案是打开服务,打开 Jenkins 的属性,点击“登录”选项卡并选中“允许服务与桌面交互”然后我通过转到 http://localhost:8080/safeRestart 重新启动 Jenkins 并单击是,现在测试将正确并行运行。

不幸的是,我现在收到有关交互式服务检测的弹出窗口,但我可以将其移至屏幕一角并忽略它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-09-26
    • 1970-01-01
    • 1970-01-01
    • 2015-10-03
    • 1970-01-01
    • 2018-11-19
    • 2017-10-04
    • 2015-04-26
    相关资源
    最近更新 更多