7

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.

1
  • Researched the topic a bit and before for when my test were running fine, it was using Selenium version(s) <2.20.0. Now that Selenium 2.22.0 has been released the IE WebDriver now has a standalone server. It's not as simple as adding the correct .dll files to run anymore. Commented Jun 19, 2012 at 15:19

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

4 Comments

How do I add the server to the project if it's not a .dll file?
I see you accepted this answer, did you figure it out, or do you want me to edit my answer to show a screenshot of what I mean?
Nevermind, I figured the correct folder where the server should be placed.
Arran's answer worked perfectly for me. Copy IEDriverServer.exe into my SeleniumTests directory, set the properties flag to Always Copy, rebuild, and then everything worked.

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.