Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Feb 20, 2019 11:45

Perfecto is upgrading the Appium support in all of the CQ Labs to use Appium's version 6.1.0 Client. As with any software, this latest version of the Appium Client implements various bug fixes and enhancements that may affect how our customers implement their automation tests. To understand what changes were made, check out the Appium documentation and check the Appium discussion site.

This page includes a set of best practices on how to adjust your Appium Java code to work with this new version of the Appium Client:

Setting pageLoadTimeout for Android apps

If you specify a native application as the value for the appPackage capability in the DesiredCapabilities object used by the constructor of the AndroidDriver instance, then switch the context to WEBVIEW prior to setting the pageLoadTimeout for your test:

        capabilities.setCapability("deviceName", "04157DF47CA01828");
        capabilities.setCapability("automationName", "Appium");
        // For Android:
        capabilities.setCapability("appPackage", "com.example.testapp");
        // capabilities.setCapability("appActivity", ".activities.BrowseActivity");
        // Name your script
        // capabilities.setCapability("scriptName", "AppiumTest");

        driver = new AndroidDriver<WebElement>(new URL("https://" + host + "/nexperience/perfectomobile/wd/hub"), capabilities);
		// pageLoadTimeout only recognized in WEBVIEW context
		driver.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS);

NOTE: If the context is not switched to WEBVIEW - Appium will throw an exception when accessing the pageLoadTimeout setting.

Performing a TouchAction click

Clicking on a button object:

Use (6.1.0): action.tap(tapOptions().withElement(element(button))).perform();  
In place of (5.0.4):; 

Clicking at a screen coordinate:

Use (6.1.0): action.tap(point(x_coord, y_coord)).perform();   
In place of (5.0.4):, y_coord).release().perform(); 

Performing Find element


Attribute ‘contentDesc’ should be replaced by bt Appium's ‘content-desc’

Please see related documentation: