How can I run NUnit(Selenium Grid) tests in parallel? [closed]
Asked Answered
I

5

8

My current project uses NUnit for unit tests and to drive UATs written with Selenium. Developers normally run tests using ReSharper's test runner in VS.Net 2003 and our build box kicks them off via NAnt.

We would like to run the UAT tests in parallel so that we can take advantage of Selenium Grid/RCs so that they will be able to run much faster.

Does anyone have any thoughts on how this might be achieved? and/or best practices for testing Selenium tests against multiple browsers environments without writing duplicate tests automatically?

Thank you.

Inkblot answered 17/10, 2008 at 16:28 Comment(1)
Does this answer your question? How can I run NUnit tests in parallel?Echelon
A
5

There hasn't been a lot of work on this subject. I didn't find anything really relevent.

However, your point is well taken. Most machines nowadays have more cores and less powerful cores compared to powerful one core cpu.

So I did find something on a Microsoft blog. The technology is called PUnit and is made especially for testing multi-threaded environment.

It's as close as possible to what you requested that I could find :)

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

Update: Link is not valid anymore. The project on CodePlex has been removed.

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

Aerialist answered 17/10, 2008 at 16:49 Comment(0)
T
2

I struggled with both these problems myself. In the end I developed a custom Nunit test runner that is capable of running multiple tests in parrallel. This combined with the Taumuon.Rakija extension for nunit allowed the tests to be dynmaically created depending on which browser you want the test to run on.

I'm now in a position where I can launch my test suite against as many browser types on as many operating systems as I wish in parrallel.

Unfortunately there doesn't seem to be a good solution to these problems already so you'll probably have to solve them yourself for your particular environment.

Translator answered 12/12, 2008 at 11:49 Comment(1)
How about you open source it?Helsie
G
1

NUnit version 3 will support running tests in parallel, this works good with a Selenium Grid:

Adding the 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 be run in parallel with other tests.

• ParallelScope.Self indicates that the test itself may be run in parallel with other tests.

• ParallelScope.Children indicates that the descendants of the test may be run in parallel with respect to one another.

• ParallelScope.Fixtures indicates that fixtures may be run in parallel with one another.

NUnit Framework-Parallel-Test-Execution

Guardafui answered 27/8, 2015 at 9:17 Comment(0)
S
0

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

However he does say "Once we integrate Selenium into acceptance testing", so it looks like he was just experimenting, I can't find any other posts so I don't know if he has successfully run Selenium tests in parallel.

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

Savannasavannah answered 13/8, 2009 at 17:15 Comment(0)
M
0

You can use the Task Parallel Library and the DynamicObject class to achieve parallelization of the same test on multiple browsers. See my article Running Selenium In Parallel with any .NET Unit Testing Tool for details.

Margalo answered 20/9, 2014 at 19:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.