I'm trying to input text into a username field. It appears to find an element, however SendKeys() errors stating that the element is not interactable. I'm already waiting until the element exists, so I wouldn't think its related to waiting. Here is my code:
Console.WriteLine("Hello, World!");
ChromeDriver cd = new
ChromeDriver(@"C:\Users\xxx\Downloads\chromedriver_win32\");
cd.Url = @"https://connect.ramtrucks.com/us/en/login";
cd.Navigate();
WebDriverWait wait = new WebDriverWait(cd,TimeSpan.FromSeconds(10));
IWebElement e = wait.Until(ExpectedConditions.ElementExists(By.ClassName("analytics-login-username")));
e.SendKeys("xxx@gmail.com");
Any suggestions would be much appreciated :)
There are 2 thing you need to fix here:
IWebElement e = wait.Until(ExpectedConditions.ElementExists(By.ClassName("analytics-login-username")));
e.SendKeys("xxx@gmail.com");
Try this:
IWebElement e = wait.Until(ExpectedConditions.ElementIsVisible(By.CssSelector("input.analytics-login-username"))).SendKeys("xxx@gmail.com");