'Selenium, unable to click element on DEVOPS
I have FontAwesomeIcon react element on page. When I run tests locally it normally works it means it finds element and do Click action. When I am running the same scenarious in devops tests it is not interactable. I tried to run click action in a lot of ways but nothing works. CODE
IWebElement btnSearchLocalization = driver.FindElement(By.CssSelector(".fa-1x"));
executorEventPlace.ExecuteScript("arguments[0].scrollIntoView(true);", btnSearchLocalization);
IWebElement btnSearchLocalization2 = driver.FindElement(By.CssSelector(".fa-1x"));
btnSearchLocalization2.Click();
I got a lot of other problems with interacting elements but in most of cases helped one of this two solutions:
executorEventPlace.ExecuteScript("arguments[0].scrollIntoView(true);", eventPlace);
executorEventPlace.ExecuteScript("arguments[0].click();", eventPlace);
How to setup devops agent correctly? How to compare it with my local computer? I also added a lot of Thread.Sleep() but this elements must be visible.
Edit Initialization:
public static IWebDriver _driver;
public static IWebDriver Instance
{
get
{
if (_driver == null)
{
ChromeOptions options = new ChromeOptions();
//options.AddArguments("start-maximized");
//options.AddArguments("--window-size=1920,1080");
options.AddArguments("--start-maximized");
options.AddArgument("--ignore-certificate-errors");
options.AddArgument("--disable-popup-blocking");
options.AddArgument("--incognito");
_driver = new ChromeDriver(@"C:\temp\chromedriver\", options);
//_driver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), options);
}
return _driver;
}
}
Exception: OpenQA.Selenium.ElementNotInteractableException : element not interactable: Element is not currently visible and may not be manipulated (Session info: chrome=99.0.4844.84)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
