I want to write the winium (selenium for desktop applications) code for desktop and selenium code for web application as this is the need of my current project. Since, we have both the applications communicating with each other for the business logic. Our main focus is to configure both winium driver and web driver so that we can work all together for a scenario to test and toggle/switch the drivers as per our need (minimize the app/browser and get the focus back).
I hope many of you have already worked for such scenarios and can guide me well here to achieve this. I have written few lines of code but that's not working for me. Do I need to run the remote web driver as well from commandline for this, if yes then please guide? Can you please look into below code and let me know what wrong with that? Also, can we create a winium driver instance without assigning it to a desk application as this would be really handy to assign later as per our need.
Looking for a +ve response.
Thanks Rafi
WebDriver and WiniumDriver configuration code:
// Set App Driver for App Elements
DesiredCapabilities app_dc = new DesiredCapabilities();
String AUT_PATH = "C:\\Windows\\System32\\calc.exe";
app_dc.setCapability("app", AUT_PATH);
WiniumDriver app_driver = (WiniumDriver) new RemoteWebDriver( new URL("http://localhost:9999"), app_dc);
// Set Web Driver for Web Elements
DesiredCapabilities web_dc = new DesiredCapabilities();
WebDriver web_driver = new RemoteWebDriver (new URL("http://localhost:4444"), web_dc);