【问题标题】:Jenkins Selenium Jobs not running in ParallelJenkins Selenium 作业未并行运行
【发布时间】:2019-09-26 21:03:00
【问题描述】:

尝试在 Jenkins 中并行运行 2 个 selenium 作业。

当我开始第一个 selenium 作业时,它运行良好(直到第 6 次迭代,如下所示)。但是当我开始第二个作业时,第二个作业正在运行而没有任何错误,但是使其他作业驱动程序停止并显示

org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:10964.

如果我们尝试单独运行这两个作业,它运行完美,没有任何错误 wrt 到 chromedriver/chrome/java 版本

-------------------------
Jenkins Output of 1st Job
-----------------------------
09/05 10:07:55 (LaunchMaxUptimeDowntime_NC2.java:119)[methodName-Steps] - Script Execution Time in Seconds for 1 Iteration: 126
09/05 10:07:55 (LaunchMaxUptimeDowntime_NC2.java:138)[methodName-Steps] - Script WaitTime for 2 iteration to start: 54

09/05 10:09:22 (LaunchMaxUptimeDowntime_NC2.java:119)[methodName-Steps] - Script Execution Time in Seconds for 2 Iteration: 33
09/05 10:09:22 (LaunchMaxUptimeDowntime_NC2.java:138)[methodName-Steps] - Script WaitTime for 3 iteration to start: 27

09/05 10:10:21 (LaunchMaxUptimeDowntime_NC2.java:119)[methodName-Steps] - Script Execution Time in Seconds for 3 Iteration: 32
09/05 10:10:21 (LaunchMaxUptimeDowntime_NC2.java:138)[methodName-Steps] - Script WaitTime for 4 iteration to start: 28

09/05 10:11:22 (LaunchMaxUptimeDowntime_NC2.java:119)[methodName-Steps] - Script Execution Time in Seconds for 4 Iteration: 33
09/05 10:11:22 (LaunchMaxUptimeDowntime_NC2.java:138)[methodName-Steps] - Script WaitTime for 5 iteration to start: 27

09/05 10:12:21 (LaunchMaxUptimeDowntime_NC2.java:119)[methodName-Steps] - Script Execution Time in Seconds for 5 Iteration: 32
09/05 10:12:21 (LaunchMaxUptimeDowntime_NC2.java:138)[methodName-Steps] - Script WaitTime for 6 iteration to start: 28

09/05 10:13:23 (LaunchMaxUptimeDowntime_NC2.java:119)[methodName-Steps] - Script Execution Time in Seconds for 6 Iteration: 34
09/05 10:13:23 (LaunchMaxUptimeDowntime_NC2.java:138)[methodName-Steps] - Script WaitTime for 7 iteration to start: 26

09/05 10:14:12 (LaunchMaxUptimeDowntime_NC2.java:144)[methodName-Steps] - Execution is stopped because of the following reason

org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:10964
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'PRINU', ip: '192.168.0.106', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201'
Driver info: driver.version: RemoteWebDriver
-----------------------------------------------
TestSuite
Total tests run: 1, Failures: 0, Skips: 0
Configuration Failures: 1, Skips: 1
-----------------------------------------------

【问题讨论】:

  • 您是否使用网格来分配负载?
  • 不..我没有使用网格
  • 我认为网格使用的端口存在问题。确保作业中使用的端口不冲突。

标签: java selenium jenkins


【解决方案1】:

在启动 ChromeDriver 之前,我在项目中使用了以下代码

Runtime.getRuntime().exec(System.getProperty("user.dir") + "/release/killchromedriver.bat");

停止 chromedriver 正在影响其他工作。感谢您的帮助!

【讨论】:

    猜你喜欢
    • 2020-09-04
    • 1970-01-01
    • 1970-01-01
    • 2016-12-22
    • 1970-01-01
    • 2015-12-03
    • 1970-01-01
    • 1970-01-01
    • 2014-01-25
    相关资源
    最近更新 更多