How can I run NUnit tests (Selenium Grid) in parallel?

My current project uses NUnit for unit tests and for managing UATs written with Selenium. Developers typically run tests using the ReSharper test runner in VS.Net 2003, and our build runs them through NAnt.

We would like to run UAT tests in parallel so that we can use Selenium Grid / RC so that they can work much faster.

Does anyone have any thoughts on how this can be achieved? and / or recommendations for testing Selenium tests in different browser environments without automatically recording duplicate tests?

Thank.

+8
c # selenium testing nunit selenium-grid
Oct 17 '08 at 16:28
source share
5 answers

There was not much work on this. I did not find anything suitable.

However, your point is well taken. Most machines currently have more cores and less powerful cores compared to the powerful single core processor.

So, I found something on the Microsoft blog. This technology is called PUnit and is specifically designed to test a multi-threaded environment.

This is as close as possible to what you asked me to find :)

You can visit the corresponding blog: http://blogs.microsoft.co.il/blogs/eyal/archive/2008/07/09/punit-parallel-unit-testing-in-making.aspx

Update: The link is no longer valid. The CodePlex project has been deleted.

Update2: This is on the roadmap for NUnit 2.5. Link

+5
Oct 17 '08 at 16:49
source share

I myself struggled with these problems. In the end, I developed a special Nunit test runner that is able to run several tests in parrallel. This, combined with the Taumuon.Rakija extension for nunit, made it possible to dynamically create tests depending on which browser you want to run.

Now I am in a state where I can run my test suite against many types of browsers on as many operating systems as I wish in parrallel.

Unfortunately, this does not seem to be a very good solution to these problems, so you may have to solve them yourself for your specific environment.

+2
Dec 12 '08 at 11:49
source share

NUnit version 3 will support parallel parallel tests, this works well with selenium mesh:

Adding an attribute to a class: [Parallelizable(ParallelScope.Self)] will run your tests in parallel with other test classes.

β€’ ParallelScope.None indicates that the test may not run in parallel with other tests.

β€’ ParallelScope.Self indicates that the test itself can run in parallel with other tests.

β€’ ParallelScope.Children indicates that descendants of the test can run parallel to each other.

β€’ ParallelScope.Fixtures indicates that luminaires can operate in parallel with each other.

NUnit Framework-Parallel-Test-Execution

+2
Aug 27 '15 at 9:17
source share

Igor Brejc has a blog post about running tests in parallel using MbUnit.

However, he says, β€œOnce we integrate Selenium into acceptance tests,” it seems like he was just experimenting, I can’t find any other messages, so I don’t know if he successfully ran the Selenium tests.

http://igorbrejc.net/development/continuous-integration/gallio-running-tests-in-parallel

0
Aug 13 '09 at 17:15
source share

You can use the parallel task library and the DynamicObject class to achieve parallelization of the same test in multiple browsers. For more details see my article Running Selenium in Parallel with any .NET block testing tool .

0
Sep 20 '14 at 19:33
source share



All Articles