lbr*_*own 7 c# selenium nunit visual-studio selenium-webdriver
我正在使用Visual Studio编写C#来构建Selenium WebDriver代码,然后将其传递给NUnit来运行我的测试.
当我第一次构建和调试我的代码时,它将传递给NUnit,我可以从那里成功运行(加载正确的浏览器加载正确的网页)
直到最近,每当我尝试在NUnit中运行它时,都会发生运行错误:
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.
Run Code Online (Sandbox Code Playgroud)
我下载了它告诉我的驱动程序,但我不确定接下来要做什么,或者把它放在我的代码中.
解压缩驱动程序,并将其放在与运行测试的文件夹相同的文件夹中。将其添加到 Visual Studio 中的项目中,确保其构建属性设置为“始终复制”。这将确保它始终被复制到与包含测试的已编译 .DLL 文件相同的构建目录。
您可以稍后移动它,但当它与测试位于同一文件夹中时,让它正常工作。
| 归档时间: |
|
| 查看次数: |
3200 次 |
| 最近记录: |