I am getting the below error screenshot when using the WinApp driver for the desktop automation.
The source code I am using to initiate the WinApp driver session as below.
public void setupDesktopAutomation(String appName, String platformName, String deviceName) {
try {
Desktop desktop = Desktop.getDesktop();
desktop.open(new File("D:\\Software\\Windows Application Driver\\WinApp\\WinAppDriver.exe"));
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("app", appName);
caps.setCapability("platformName", platformName);
caps.setCapability("deviceName", deviceName);
windowsDriver = new WindowsDriver(new URL("http://127.0.0.1:4723/"), caps);
windowsDriver.manage().wait(5000);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
I did many research on this and found that the Selenium version 4 (I am using the Selenium Version 4.7.2) is not compatible with the latest WinApp driver. There are many articles found in the web that we need to downgrade the Selenium version to 3.141.1 in order to WinApp driver to work
- https://github.com/microsoft/WinAppDriver/issues/1774.
- https://github.com/microsoft/WinAppDriver/issues/1839
Also I found that in few articles that we can use Selenium Version 4 and still connect to the WinApp driver using the Appium as a middle man. But those articles does not shown how we can do this. Please check the below article.
So I want to know without downgrading the selenium version, how I can modify the above source code to initiate the WinApp driver successfully.