Karate UI - Running scenarios in parallel throws an error 'HttpHostConnectException: connect to localhost:9222'

本小妞迷上赌 提交于 2020-11-25 04:27:15

问题


I am trying to execute a feature with 3 scenarios in it using:

Results results = Runner.parallel(tagQuery, featurePaths, null, new ArrayList<>(), 3, karateOutputPath);

With @parallel=false works fine however when I removed, it fails with the following error:

com.intuit.karate.exception.KarateException: test_input.feature:50 - driver config / start failed: 
org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect, options: {type=chrome, target=null}

This occurs at the * driver <url> phase. This is an intermittent failure which most of the time 2/3 scenarios pass and one fails with this error.

Version: 0.9.6.RC3


回答1:


Sorry, running browser tests in parallel is non-trivial which is why we have the Docker option.

Consider that this is not supported on a single node. It can be made to work if you know what you are doing, but you need to figure this out depending on whether you are using Chrome or WebDriver.

Please refer the docs: https://twitter.com/ptrthomas/status/1159295560794308609 | https://github.com/intuit/karate/tree/master/karate-core#configure-drivertarget

EDIT - also see this answer: https://stackoverflow.com/a/60387907/143475




回答2:


I recommend using Zalenium like Remote Browser Grid to achieve parallelism and make sure that your scenario are self-contained or atleast keep feature independent.



来源:https://stackoverflow.com/questions/62324287/karate-ui-running-scenarios-in-parallel-throws-an-error-httphostconnectexcept

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!