I need help on how to change focus when a new window is opened in the WPF application with WinAppDriver
With WinAppDriver I am able to open a WPF application and test using the code below, I need help on how to change focus when a new window is opened in the WPF application. the Problem with WPF applications is that you cannot use the standard method, as the driver will not recognize the app. there should be a way to help switch focus or at least open an existing WPS application window which I cannot do right now. if anybody could help, I would greatly appreciate it.
// to open the standard app
AppiumOptions options2 = new AppiumOptions();
options2.AddAdditionalCapability("app", "Application new window");
options2.AddAdditionalCapability("Window", "WindowsPC");
//to open a WPS application
AppiumOptions options = new AppiumOptions();
options.AddAdditionalCapability("app", @"C:\Path\Debug\Application.exe");
options.AddAdditionalCapability("deviceName", "WindowsPC");
_driver = new WindowsDriver(new Uri("http://127.0.0.1:4723"), options);
{"desiredCapabilities":{"app":"[@Name =\"Loan Folder 14847\"]","Window":"WindowsPC","platformName":"Windows"},"capabilities":{"firstMatch":[{"platformName":"Windows"}]}}
HTTP/1.1 500 Internal Error
Content-Length: 101
Content-Type: application/json
{"status":13,"value":{"error":"unknown error","message":"The system cannot find the file specified"}}