0

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);

1 Answers1

0

Try to use below configuration for WiniumDriver DesiredCapabilities

IOSDriver driver = null;

String appPath = "Microsoft.WindowsCalculator_8wekyb3d8bbwe!App";       //The Windows Calculator app

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "WindowsModern");
capabilities.setCapability("app", appPath);

System.out.println("Set DesiredCapabilities..");

try {

    driver = new IOSDriver(new URL("http://127.0.0.1:4723"), capabilities);

 } catch (MalformedURLException e) {
    e.printStackTrace();
 } catch (Exception e) {
    e.printStackTrace();
}
Ali Azam
  • 2,047
  • 1
  • 16
  • 25
  • Thank you so much @Ali, this problem is been resolved. Actually, facing issue with WebDriver setup with RemoteWebDriver with selenium version 3.11.0. Can you please help me to config that as well? – Rafi Ansari Apr 29 '18 at 05:35