Running Specflow test in Parallel using Specflow 2.0 and NUnit 3.x
Karthik kk
In this post we will discuss one of the cool new feature introduced by Specflow 2.0, which is Parallel execution support out-of-box along with NUnit 3.x.
Does NUnit 3.x support parallel execution?
Yes it does, NUnit parallel execution support is discussed in greater details in Selenium automation with C# video series of ExecuteAutomation youtube channel
Parallel execution consideration
In order to achieve parallel test execution, there are some important consideration needed to be taken care before you ensure your test runs properly
Parallel execution with memory isolation (AppDomain)
Ensure your test code executing the application is not depends on static states (e.g. external cache, databases etc), if so then
This can be achieved by isolating test into AppDomain, this ensures that every test execution thread is hosted in a separate AppDomain and that each thread’s memory
Parallel execution without memory isolation (AppDomain)
If your tests do not depend on any static states (ie. do not store any test-specific information in static fields), you can run the tests in parallel without AppDomain isolation
What’s the code change in existing specflow code ?
It’s fairly very simple, just one line of additional change in AssemblyInfo.cs file and you are good to go and the change is this
Here is the complete video of the above discussion
Thanks for reading the post and watching the video!!!
Please leave your comments and let me know if there is anything I should update in this post.
Thanks,
Karthik KK