How do you run tests in parallel using robot framework? Issues with Parallel Library

落爺英雄遲暮 提交于 2020-06-23 07:35:07

问题


The below is the code present in parallel_tests.txt

*** Settings ***
Library         Parallel  

*** Test Cases ***
Runner
    Run Parallel Tests  Hello   World

Hello
    [Tags]  parallel
    Log     Hello123 

World
    [Tags]  parallel
    Log     World123

I am trying to execute this test case file from terminal using jybot as below: jybot parallel_tests.txt;

I am getting the following error: No keyword with name 'Run Parallel Tests' found.

How to execute both test cases Hello and World ,in parallel in robot framework using parallel library.


回答1:


Slightly different use case but have you tried using pabot?

I haven't gone down the rabbit hole with this one so don't have an in-depth understanding but I do use it for cross-browser tests via sauceLabs. It will work differently from how you want in that it does parallel runs but by test suite rather than test case level. Perhaps this is configurable? Unfortunately as mentioned I just know enough to get it working for my needs and haven't done a deep dive.

Any questions let me know and I'll try to help.

Here's a quick example as requested, I've stripped lots of our stuff which is useless in your case but left some in so you can see how to build up. I changed the processes parameter from %processes% to 2, the end result is the same, in my case these values are coming from a teamcity build configuration:

pabot --processes 2 --variable environment:%environment% --name OS_X_10.9-Firefox --variable browser:%browser% --listener robot-tc-listener --include %includetags% --exclude %exclusiontags% --outputdir %PabotResults_DIR% --output output.xml --report report.html --log log.html tests



回答2:


Which version of RobotFramework are you using? The Parallel library was removed in 2.5 (see this ticket, though there may be distant plans of reintroducing it).

I tried to reproduce your issue using this file with RF version 2.8, but there are several compatibility problems, as expected.

Are you sure that the library has been loaded properly? When it fails, in addition to the error, you will also get a message telling you that the keywords are unavailable.



来源:https://stackoverflow.com/questions/32110330/how-do-you-run-tests-in-parallel-using-robot-framework-issues-with-parallel-lib

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