Jenkins Selenium Jobs未并行运行

时间:2019-05-09 04:56:27

标签: java selenium jenkins

试图在Jenkins中并行运行2个硒作业。

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

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

如果我们尝试分别运行这两个作业,则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
-----------------------------------------------

1 个答案:

答案 0 :(得分:0)

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

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

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