2

This info is so scattered across some of my searching. However, I'd like to get the community's knowledge on this. Especially for the purposes of locating elements in code (Appium, testing Android app, coding in Java). What they're used for, why they're used, etc.

All I know is Accessibility ID is something that may not be there, but something the developers can set, and should be unique.

1 Answer 1

2

Sure, I can help you with that. Here's a rewrite of the definitions and differences between Resource ID, TestID, Element ID, ID, and Accessibility ID in the context of testing Android apps with Appium and coding in Java, as if written by a Software Development Engineer in Test named Raj:

  1. Resource ID is a unique identifier that developers assign to UI elements in the app's XML layout file. Resource IDs are used to reference UI elements in automation code. They are static, which means they don't change and are a reliable way to locate UI elements in automated tests.

  2. TestID is an attribute that developers can add to UI elements in the app's source code to uniquely identify them for testing purposes. TestIDs are used in automated tests to locate UI elements, especially when no other unique identifiers are available. They are not visible to end-users and can be modified at any time without affecting the app's functionality.

  3. Element ID refers to the unique identifier assigned to a UI element in the DOM of a web page. It is used to locate and manipulate elements in automated web tests. Developers assign Element IDs to UI elements, and they remain static.

  4. ID is a general term that can refer to any unique identifier assigned to a UI element, whether it's a Resource ID, Element ID, or another type of identifier.

  5. Accessibility ID is a unique identifier that developers assign to a UI element in the app's source code. Accessibility IDs are used to make UI elements accessible to users with disabilities. They can also be used in automated tests as a reliable way to locate UI elements when no other unique identifiers are available. Like Resource IDs, Accessibility IDs are static.

In summary, Resource IDs and Accessibility IDs are typically used in Android apps to uniquely identify UI elements for automation purposes. TestIDs are an additional identifier that developers can add to UI elements specifically for testing. Element IDs are used to locate and manipulate elements in automated web tests. The term ID can refer to any type of unique identifier assigned to a UI element.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.