3

I have a MAC OSX native application. Some of the screens in this application is using Webviews.

My specific requirement is to automate this view using Selenium.

Questions that I have:

  1. Is it really possible to use Webdriver to automate the Webviews in a native MAC OSX hybrid application?
  2. If yes, can someone give an example script?
  3. If it's possible to automate, how to identify the elements on this Webview?

I also tried with appium-for-mac for automating, but failed. (Seems like its a known issue as per: This post

My current setting for the webdriver setup is:

private WebDriver buildDriverInstance(String appiumForMacURL){

    URL remoteAddress = null ;
    try {
        remoteAddress = new URL(appiumForMacURL);
    } catch (MalformedURLException e) {
        e.printStackTrace();
    }

    DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
    desiredCapabilities.setCapability("platform","Mac");
    WebDriver driver;
    driver = new RemoteWebDriver(remoteAddress,desiredCapabilities);
    return driver;
}

Any direction in this regard?

1 Answer 1

1

If it's possible to automate, how to identify the elements on this Webview?

I have used the Appium Inspector to find the selector. This gave me an XPATH selector that, while slow, worked well enough. This is unlike switching context to the WebView in a hybrid app.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.