A little while back I wrote a post on achieving concurrent or parallel test running with Selenium, Specflow and NUnit2, but what about NUnit3? Let's have a look at that, thankfully it is a bit simpler than running an external build script as done previously. First up, according to the Specflow docs - open up your AssemblyInfo.cs file in your project and add the following line: [cc lang="c#" widt...
PhantomJS is a headless web driver which will enable you to execute your Selenium tests without having to spin up a driver, this can improve the speed of your tests and use less resources. Commonly it is used in your CI builds when running acceptance tests.
It’s easy to implement and get up and running with lets get a copy of it from PhantomJS.org.
Next lets add the executable to our C# solution, set to Copy if newer and setup the driver:
PhantomJSDriverService service = PhantomJSDriverService.CreateDefaultService();
service.LoadImages = false;
Driver = new PhantomJSDriver(service);
You will notice I have included an service argument which is quite self explanatory, there are a number of these but rather than view them in detail here you can explore more options in the PhantomJS documentation.
You should now be able to run your tests without actually seeing anything on screen.