I would like to test my app against diverse versions of Chrome & Firefox on multiple machines & platforms and avoid duplicating webdriver.dll into every driver-folder. So I came up with the following folder-structure for the drivers:
--Drivers / Chrome80 / Win /
+------ / Unix /
+----- /Mac /
/ Chrome 81 ...
/ Firefox73 / ...
/ WebDriver3
/ WebDriver4
So then my code uses the webdriver.dll from the appropriate dir (and in case of v3 also webdriver.support.dll) and I'm instantiating i.e. ChromeDriver by using the constructor-syntax that gets an instance of
ChromeOptions. The only option that I set is
BinaryLocation, its value is "C:\blah\Drivers\ChromeDriver81\Win\chromedriver.exe" and that file exists.
However, I do get this:
OpenQA.Selenium.DriverServiceNotFoundException: The chromedriver.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://chromedriver.storage.googleapis.com/index.html.
bei OpenQA.Selenium.DriverService.FindDriverServiceExecutable(String executableName, Uri downloadUrl)
bei OpenQA.Selenium.Chrome.ChromeDriverService.CreateDefaultService()
bei OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeOptions options)
It also happens with WebDriver 3.1 and also with Firefox (geckodriver73) when setting options.BrowserExecutableLocation. I can't imagine an error in Selenium would have gone undetected for so long. But I also can't see what I might be doing wrong - so any insight will be much appreciated.