4

I'm writing the Selenium test cases for each screen to test the different scenarios. In our project for each build in Jenkins, its Selenium test cases (QA) also runs automatically.

My problem is even though it's automated, it's taking a lot of time to run. I have 380 test cases and it's taking 20-25 minutes. How can I reduce the time? Are there any other ways or techniques to follow?

4

2 回答 2

0

在您拥有的 380 个测试用例中,检查是否真的需要所有测试用例。如果需要所有测试用例,请检查您是否有任何重复验证,并查看是否可以删除其中任何一个。

如果您在测试用例中使用等待时间,请查看是否可以在不影响测试用例输出的情况下减少等待时间。

最好的办法是将它们分成不同的组并使用 Grid 在不同的机器上运行它们。或者使用 TestNg/JUnit 并行运行 testCases。

在 TestNg 中,在 testng.xml 文件中,您可以使用以下内容并行运行它们

<suite name="ParallelTests" verbose="5" parallel="methods" thread-count="10">

于 2015-03-24T08:43:06.380 回答
0

you can check for the Selenium grid option, which will help you to run the tests in parallel. http://selenium-grid.seleniumhq.org/

于 2011-09-23T12:04:12.150 回答