Cross-environment Compatible ID Locators (Android)


When we're automating Android applications, QA teams might get resource IDs that are environment-specific. These IDs typically follow the pattern <package_name>:id/<id_value>

For Example:

io.testsigma.tsdemo:id/startUserRegistration

Here, the package name io.testsigma.tsdemo may vary across different environments, such as:

  • io.testsigma.tsdemobeta
  • io.testsigma.tsdemoalpha

In these cases, it is important to parameterize the package name within the UI identifier.

Solution

In such cases, it is recommended to use only the <id_value> portion of the resource ID. For the given example, startUserRegistration would be used.

Testsigma simplifies this process by automatically appending the appropriate package name, from the test app selected, to the resource ID.

One more example: Testsigma shows the attributes of selected elements on the login page below with ID values only.

Example

For more information, refer to create dynamic elements using parameter.