1

I decided to switch from current solution (using modified NUnit by our team some years ago NDistribUnit which run tests on VirtualMachines and then gather results on hub server) to Selenium Grid 2.

Option with ParallelizableAttribute was tried. Unfortunately I noticed that IWebDriver was stored in Global variable (puhh). This caused tests to start several browser instances, but tests used single IWebDriver -> tests execution happened in single browser -> tests were run under single process, but with several 'worker' threads. It was tried using 2 VMs as 'nodes' and local PC as Hub.

I know best solution is to change invalid idea to store driver in global variable, but it'll take too much time: there are 3k+ heavy UI tests to be updated; many static methods expected to have driver as global var to be updated also.

As well NUnit 3.0 provides Option to run several assemblies in parallel. To run several test projects it's good, but currently we have 1 assembly per one application. It would be nice to run tests for one application (one assembly) in parallel.

Is there other ways to use GRID + NUnit 3 here to make it work?


Finally, existed solution were refactored: now each test during execution has own driver. Due to this change a lot of code was re-written (it appears that too much methods expected to have IwebDriver as global variable)

2
  • Can you explain better which problem do you have and what it is connected with? How do you store your IWebDriver? Give us examples. Commented Dec 29, 2015 at 14:15
  • Hi Denis, The main goal is to find out which options are available now (with NUnit 3.0) to run tests in parallel. For this moment I can name 2: 1. Use ParallelizableAttribute for each class with tests - works, but not for me, because current solution has IWebDriver defined as: public static IWebDriver _browser; 2. Use NUnit 3.0 - ProcessModel.Parallel thing to run each assembly in another process. Commented Jan 5, 2016 at 13:18

1 Answer 1

0

Actually, there are 2 options to do that:

  1. Refactoring - it's done for one test project. Along with removing static variables (initial refactoring purpose) other code was changed as well. A great minus - significant effort was required.
  2. Using TeamCity agents for parallel run. I forgot to mention finally tests are being executed on TeamCity, but by single agent. For left 'old' tests (where Driver instance was stored in static variable) several TC agents were configured to run only several classes from tests solution. This option is very 'fast' and doesn't require big code changes.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.