简体   繁体   中英

Parallel tests with Gherkin, Specflow and Selenium

I'm setting up automated acceptance tests for an Asp.Net MVC project using Gherkin scenarios, Specflow steps and Selenium remote webdriver. The aim is to run the tests from Jenkins in parallel on multiple nodes using the selenium server hub.

At the moment I'm trying to get them to run in parallel locally and having some difficulties. Is it even possible to run those tests in parallel with the Gherkin/Specflow setup or does the fact the Gherkin scenarios re-use the same Specflow steps for similar scenarios make it impossible to run them concurrently ?

If it's not impossible how exactly can it be done ? And if it is impossible what else could be done to speed up the testing process ?

It has nothing to do with

the fact the Gherkin scenarios re-use the same Specflow steps for similar scenarios make it impossible to run them concurrently

It's totally possible to run your MSTest cases in parallel . As far as I'm aware the max number of hung tests shouldn't exceed 5 . However I've used custom tool for this purpose, spawning every test in a separate thread, it's easy achievable with TPL .

You'll need to use the selenium grid to do this, and I would recommend putting the grid on another computer or virtual machine if you can.

You can run the same test on multiple browsers using a combination of 1) the task parallel library and 2) the dynamic object class. I've written about the specifics here http://blog.dmbcllc.com/running-selenium-in-parallel-with-any-net-unit-testing-tool/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM