NUnit error when running my C # Selenium WebDriver code

I write in C # using visual studio to create Selenium WebDriver code, and then pass it through NUnit to run my tests.

When I first built and debugged my code, it would switch to NUnit and I could work from there successfully (loading the right browser loading the correct web pages)

Until recently, when I try to run it in NUnit, a runtime 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 that told me, but I'm not sure what next or where to put it in my code.

+7
source share
1 answer

Unzip the driver and place it in the same folder in which the tests are run. Add it to the project in Visual Studio to ensure that the assembly properties are set to Always Copy. This ensures that it will always be copied to the same assembly directory as the compiled .DLL file containing your tests.

You can move it later, but make it work when it is in the same folder as the tests.

+3
source

All Articles