【发布时间】: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