I'm trying to use Selenium with version 74 of chrome. I downloaded the most current updates from Selenium and the ChromeDriver as instructed by the documentation. This was my functioning code before the upgrades -
IWebDriver driver = new ChromeDriver();
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(8));
{
driver.Url = "https://iam.mySite.com";
};
but after the upgrade I began getting the error
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
Because of that error, I changed my code to this
IWebDriver driver = new ChromeDriver(@"C:\Users\UserName\.nuget\packages\selenium.webdriver.chromedriver\74.0.3729.6\driver\win32");
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(8));
{
driver.Url = "https://iam.mySite.com";
};
But now I'm getting this error -
OpenQA.Selenium.NoSuchElementException: 'no such element: Unable to locate element:
{"method":"xpath","selector":"//*[@id='username']"}
(Session info: chrome=74.0.3729.131)
(Driver info: chromedriver=74.0.3729.6)
I double checked the username xpath and it hasn't changed. Is there an easy way to downgrade my chrome version? Am I putting the driver in the wrong folder?