I am testing a CEF app which is already launched so I am trying to attach to it using the DebuggerAddress option.
- Browser: Microsoft Edge 107.0.1418.24
- Driver: msedgedriver 107.0.1418.24
EdgeOptions used:
EdgeOptions edgeOptions = new EdgeOptions();
edgeOptions.DebuggerAddress = "localhost:9222";
edgeOptions.AddArguments("window-size=1680x1050");
edgeOptions.AddArguments("no-sandbox");
Driver = new EdgeDriver(edgeOptions);
Driver.Navigate();
MyTest:
public void Test()
{
var item = Driver.FindElement(By.Id("tableItem")); //test fails here
item.Click();
}
Error message:
Message:
OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"css selector","selector":"#tableItem"}
(Session info: MicrosoftEdge=107.0.1418.24)
As per CEF documentation, CEF apps should be tested using Chromedriver, but when I tried it gave me the following error:
Message:
OpenQA.Selenium.WebDriverException : unknown error: cannot connect to chrome at localhost:9222
from unknown error: unrecognized Chrome version: Edg/107.0.1418.24
ChromeOptions used:
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.AddArguments("window-size=1680x1050");
chromeOptions.AddArguments("no-sandbox");
chromeOptions.DebuggerAddress = "localhost:9222";
Driver = new ChromeDriver(chromeOptions);
Driver.Navigate();