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:UserslbrownDocumentsVisual Studio 2010ProjectsClassLibrary15ClassLibrary15binDebugIEDriverServer.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.
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.
链接地址: http://www.djcxy.com/p/10874.html上一篇: SQLAlchemy使用关系导入表