0

I have a Selenium Grid host on machine H and I have two grid nodes: machine N1 and machine N2. Both nodes have the same capabilities.

I have four tests: test1 => test4. I launch the tests on the host machine using nunit console: nunit3-console Test.dll --where="method =~ Test".

All tests are executed on machine N1. When I launch them again, all tests are executed on machine N2. Next time on machine N1 and so on.

I expected to have test1 executed on N1, test2 on N2, test3 on N1 and test4 on N2.

I tried to put "[assembly: Parallelizable(ParallelScope.Fixtures)]" in AssemblyInfo.cs but that didn't help. The tests are still all executed on the same node.

What am I missing?

Nicolae Daian
  • 1,065
  • 3
  • 18
  • 39
  • Possible duplicate of [Selenium Grid in C# Parallel execution with Nunit](https://stackoverflow.com/questions/38993258/selenium-grid-in-c-sharp-parallel-execution-with-nunit) – A. Kootstra Jun 05 '17 at 16:57

1 Answers1

0

Use the NUnit3 Parallelizable attribute. If you put the [Parallelizable] annotation above each test fixture (class), then each class's tests will run as a group on a separate browser/tab. To get a Test to run on a specific node, you'll need to define a desiredCapability. I use the undocumented applicationName capability to do so.

Timothy Cope
  • 482
  • 2
  • 11