Home

Selenium webdriver

Hello,

How do I use Selenium webdriver with Linqpad? chromedriver.exe islocated the same folder as the script. When I run the code it generates the followin exception.

Exception:

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.

Code:

var path = Path.GetDirectoryName(Util.CurrentQueryPath);
var driverBinary = $"{path}\\chromedriver.exe";
System.Environment.SetEnvironmentVariable("webdriver.chrome.driver",
driverBinary);
IWebDriver browser = new ChromeDriver();

This code works well in VS.

Comments

Sign In or Register to comment.