Run an app from the baseboard

This article explains how to resolve the following error, which occurs when you try to run an application by XPath of the baseboard element: "An element could not be located on the page using the given search parameters"

Solution

This behavior is consistent with pure Appium, due to a stricter check for whether the active application is the application under test.

Use the following code to start another application using the Perfecto extension, which will in turn disable Appium's front app validation:

Copy
    Map<String, Object> settingsHashMap = new HashMap<>();
    settingsHashMap.put("identifier", "com.apple.Preferences");
    Object result7 = driver.executeScript("mobile:application:open", settingsHashMap);
    Map<String, Object> params6 = new HashMap<>();
    params6.put("keySequence", "HOME");
    Object result6 = driver.executeScript("mobile:presskey", params6);