[英]Is there any way to run robot framework test suites in parallel?
I have 5 test suites which are independent of each other. 我有5个相互独立的测试套件。 I have to run it against the same environment. 我必须针对相同的环境运行它。 Most of my test suites consist of API calls. 我的大多数测试套件都包含API调用。 The test cases inside the suites should run in sequence as they are dependent on each other. 套件内的测试用例应按顺序运行,因为它们相互依赖。
Is there any way we can run all the test suites in parallel via the pybot command? 有没有什么办法可以通过pybot命令并行运行所有测试套件?
There is no native handling of parallel executions of tests in Robot Framework. Robot Framework中没有本地处理并行执行测试的方法。 There is Pabot, a parallel executor for RF . Pabot是RF的并行执行器 。 Pabot allows test suite distribution and makes a combined report and log. Pabot允许测试套件分发并组合报告和日志。
We also at Workshare had our take on the matter (at the time we did not know about Mikko work) and we recently open sourced it. 我们也在Workshare处理了这件事(当时我们不知道Mikko工作),我们最近开源了。 It's now production level, as we use it to launch in parallel our tests on our CI (jenkins). 它现在是生产级别,因为我们使用它来并行启动我们的CI(jenkins)测试。 It can produce a complete final report, it can rerun failed tests, it has a global setup/teardown mechanism, it generates xunit compatibles result files, and it also works on Windows :) (altough Linux is a better option!) 它可以生成一个完整的最终报告,它可以重新运行失败的测试,它有一个全局设置/拆卸机制,它生成xunit兼容结果文件,它也适用于Windows :)(尽管Linux是一个更好的选择!)
You find it at: https://github.com/workshare/parallel_pybot 您可以在以下网址找到它: https : //github.com/workshare/parallel_pybot
When the tests are completely stand-alone and can run completely parallel I have had some success with just writing an execution script that iterates through all the IP addresses of the units on which I would want to run a test in parallel and then calling the test with that IP address as an argument. 当测试完全独立并且可以完全并行运行时,我已经取得了一些成功,只需编写一个执行脚本,该脚本遍历我想要并行运行测试的单元的所有IP地址,然后调用测试以该IP地址作为参数。 I also tell it to only create the output.xml files, naming them based on the hostname or IP address, and then the scrip does post-processing with rebot which creates an aggregated report with all the units. 我还告诉它只创建output.xml文件,根据主机名或IP地址命名它们,然后脚本使用rebot进行后处理,这会创建一个包含所有单元的聚合报告。
The simple solution is using Jekins: 简单的解决方案是使用Jekins:
Just set the parameter in Jenkins job build section, such as: 只需在Jenkins作业构建部分中设置参数,例如:
Then trigger upstream job. 然后触发上游作业。 you will get them running in parallel. 你会让它们并行运行。
But still you need to make sure the file you accesing is locked by one of the testing job. 但是仍然需要确保您访问的文件被其中一个测试作业锁定。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.