I am trying to do UI automation for a Windows app made with WPF and CEF(Chromium Embedded Framework). I couldn't find much stuff online on this topic.
Note: The App trying to UI test is already running on windows 10 and it can be found minimized with the tray icons.
What I am trying to accomplish is to 1. Open the app 2. Search for elements in the app. This is the code snippet i have written to open the app.
[TestMethod]
public void TestMethod1()
{
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.BinaryLocation = "C:\\Program Files (x86)\\App\\AppClient.exe";
System.Environment.SetEnvironmentVariable("webdriver.chrome.driver", @"C:\Users\source\repos\bin\Debug\chromedriver.exe");
IWebDriver webDriver = new ChromeDriver(chromeOptions);
}
When I run this I get the error
Message: Test method WebViewPoc.UnitTest1.TestMethod1 threw exception: OpenQA.Selenium.WebDriverException: unknown error: Chrome failed to start: exited normally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location C:\Program Files (x86)\App\AppClient.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Stack Trace: RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) RemoteWebDriver.ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) ChromeDriver.ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout) ChromeDriver.ctor(ChromeOptions options) UnitTest1.TestMethod1() line 25
Note: I have edited some of the dir location and names.
Will be great if someone could help with this and if someone has automated this kind of application before will be great to get some code for this.