SeeTest Client - Accessibility Inspection
Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .
SeeTest Automation provides an API to interact with the accessibility inspector service directly.
Commands
-
AccessibilityStart - Starts the Accessibility Inspector service on the device.
-
AccessibilityMoveNext - Moves the Accessibility Inspector to the next element.
-
AccessibilityMovePrevious - Moves the Accessibility Inspector to the previous element.
-
AccessibilityActivate - Activates the current element highlighted by the Accessibility Inspector. This enables actions on the element.
-
AccessibilityFocusedElement - Gets current element and its information highlighted by the Accessibility Inspector.
-
AccessibilityStop - Stops the Accessibility Inspector service on the device.
Usage
In order to utilize Accessibility Inspector, use AccessibilityStart. Otherwise none of the other accessibility commands work.
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.
Basic iOS Test Flow
try{
client.accessibilityStart();
client.launch("com.experitest.ExperiBank", true, false);
client.accessibilityMoveNext();
client.accessibilityMoveNext();
client.accessibilityActivate();
String str = client.accessibilityFocusedElement();
JSONObject jsonObject = new JSONObject(str);
assertEquals(jsonObject.getString("label").equals(<Expected value>));
}finally{
client.accessibilityStop();
}
Basic Android Test Flow
try{
client.accessibilityStart("com.experitest.ExperiBank");
client.launch("com.experitest.ExperiBank", true, false);
client.accessibilityMoveNext();
client.accessibilityMoveNext();
client.accessibilityActivate();
String str = client.accessibilityFocusedElement();
JSONObject jsonObject = new JSONObject(str);
assertEquals(jsonObject.getString("label").equals(<Expected value>));
}finally{
client.accessibilityStop();
}