c#Selenium 初始化异常OpenQA.Selenium.DriverServiceNotFoundException

3 1月

c#Selenium 初始化异常OpenQA.Selenium.DriverServiceNotFoundException

System.TypeInitializationException: “”的类型初始值设定项引发异常。 ---> 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.

https://stackoverflow.com/questions/9088367/chromedriver-does-not-exist-in-selenium-webdriver-c-sharp-test-script

IWebDriver driver = new ChromeDriver(@"C:\my\path\to\chromedriver\directory");