0
votes

Im trying to run test cases by calling debug dll from cmd, but all tests failed due to an error I found in log files:

Test method SeleniumUnitTest.SearchTests.SearchByProviderLocationTest threw exception: OpenQA.Selenium.DriverServiceNotFoundException: The IEDriverServer.exe file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at http://selenium-release.storage.googleapis.com/index.html.

Says that IEDriverServer.exe does not exists, but the driver is already on the DLL directory... also I dont have issues when I run unit tests from visual studio.

The command I runned is:

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\mstest.exe" /testcontainer:"C:\Users\John\Source\Repos\APP\Src\App.TestSelenium\bin\Debug\App.TestSelenium.dll"

Any idea?

Thank you.

1

1 Answers

0
votes

There are two ways to resolve this issue

  1. Store InternetExplorer.exe in a common folder and add it to Environment PATH variable. This is the best way to avoid the hassle of storing the drivers in the solution folder
  2. But if you would want to have a better control of versions of the driver, it is good to put all the drivers in the solution root folder and then when initializing the driver, specify the path

    var driver = new InternetExplorerDriver((Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)));