Finding a Selenium Location Search Path

I am trying to configure selenium tests in nCrunch, which outputs the tests to my own temp folder.

I get the following error when creating a driver ( new PhantomJSDriver() ):

OpenQA.Selenium.DriverServiceNotFoundException: PhantomJS.exe does not exist in the current directory or in the directory in the PATH environment variable.

However, I checked and PhantomJS.exe exists in the current directory (\ bin \ debug).

Then I tried to use new PhantomJSDriver(".\\") , which should be the current directory and which works.

What is the "current directory" of Selenium referencing this post?

+7
c # selenium phantomjs ncrunch
source share
1 answer

Instead of specifying ".\\" get the current working directory Directory.GetCurrentDirectory or System.AppDomain.CurrentDomain.BaseDirectory . See Get the current folder path .

0
source share

All Articles