Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • The website user interface elements are all DOM elements, and should be accessed (via XPath) using the WEBVIEW context.

    Code Block
    languagejava
    themeMidnight
    driver.context("WEBVIEW");
    driver.findElementByXPath("//*[text()='MyButton']").click();


  • The application wrapper elements (for example, application header), and the XCUIElementTypeWebViewthat encapsulates the website are all native application elements, and should be accessed (via XPath) using the NATIVE_APP context.

    Code Block
    languagejava
    themeMidnight
    driver.context("NATIVE_APP");
    RemoteWebElement element = (RemoteWebElement)driver.findElementByXPath("//XCUIElementTypeWebView");
    String elementID = element.getId();
    
    // Outer WebView element can be scrolled using the scroll object command
    HashMap<String, String> scrollObject = new HashMap<String, String>();
    scrollObject.put("element", elementID);
    scrollObject.put("direction", "down");
    driver.executeScript("mobile:scroll", scrollObject);


Legacy | Automating the PWA from Native Automation

Section


Column
width50%

Using the Perfecto Lab IDE to automate the PWA, is possible using the new Applications functions:

  • Use the Start PWA (under “Applications”) function to activate the PWA and provide the display name of the PWA icon as a parameter.
  • Use the Stop PWA (under “Applications”) function to stop the PWA execution, no parameters needed.
    Note: Stop PWA function will only close the PWA if it is running in the foreground, otherwise it will throw an error.


Column
width45%


...