Skip to main content

Accessibility Inspection

Appium Automation provides an API to interact with the accessibility inspector service directly.

You can use the Accessibility Inspector in these ways:

  • SeeTest Extension
  • Script Execution

Commands

Usage

In order to utilize Accessibility Inspector, use AccessibilityStart. Otherwise none of the other accessibility commands work.

info

For Android devices, the target package needs to be specified using accessibilityStart(targetPackage).

Once Accessibility Inspector is activated, Continuous Testing Cloud performs the Home command and the device returns to springboard.

Use AccessibilityStop to stop the service.

info

Replace <server> with the appropriate URL.

Basic iOS test flow

DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability(MobileCapabilityType.UDID, "<deviceid>");
driver = new IOSDriver(new URL("<server>"), dc);
SeeTestClient seetest = new SeeTestClient(driver);
try{
seetest.accessibilityStart();
seetest.launch("com.experitest.ExperiBank", true, false);
seetest.accessibilityMoveNext();
seetest.accessibilityMoveNext();
seetest.accessibilityActivate();
String str = seetest.accessibilityFocusedElement();
JSONObject jsonObject = new JSONObject(str);
assertEquals(jsonObject.getString("label").equals(<Expected value>));
}finally{
seetest.accessibilityStop();
}

Basic Android test flow

DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability(MobileCapabilityType.UDID, "<deviceid>");
driver = new AndroidDriver(new URL("<server>"), dc);
SeeTestClient seetest = new SeeTestClient(driver);
try{
seetest.accessibilityStartLaunchApp("com.experitest.ExperiBank");
seetest.launch("com.experitest.ExperiBank", true, false);
seetest.accessibilityMoveNext();
seetest.accessibilityMoveNext();
seetest.accessibilityActivate();
String str = seetest.accessibilityFocusedElement();
JSONObject jsonObject = new JSONObject(str);
assertEquals(jsonObject.getString("label").equals(<Expected value>));
}finally{
seetest.accessibilityStop();
}