Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NUnit error running my c# Selenium WebDriver code

I'm writing in C# using visual studio to build a Selenium WebDriver code and then passing it through NUnit to run my tests.

When I first built and debugged my code it would pass to NUnit and I could run successfully from there (Loading the correct browser loading correct webpages)

Until recently whenever I try to run it in NUnit a run error occurs:

FirstSeleniumTest.SeleniumTest.TestGoogle:
SetUp : OpenQA.Selenium.WebDriverException : You will need to use add InternetExplorerDriver.UseLegacyInternalServer to the desired capabilities to use the internal native code server library. This functionality will be deprecated in favor of the standalone IEDriverServer.exe server.
  ----> OpenQA.Selenium.DriverServiceNotFoundException : The file C:\Users\lbrown\Documents\Visual Studio 2010\Projects\ClassLibrary15\ClassLibrary15\bin\Debug\IEDriverServer.exe does not exist. The driver can be downloaded at http://code.google.com/p/selenium/downloads/list
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.

I downloaded the driver it told me but I'm not sure what to next or where to put it in my code.

like image 854
lbrown Avatar asked Jun 15 '12 19:06

lbrown


1 Answers

Unzip the driver, and put it in the same folder as where the tests are running from. Add it to the project in Visual Studio, ensuring it's build properties are set to 'Copy always'. This will ensure it is always copied to the same build directory as the compiled .DLL file containing your tests.

You can move it later, but get it working when it is in the same folder as the tests are.

like image 155
Arran Avatar answered Sep 19 '22 07:09

Arran