How do I store content description for the element in mobile apps?
This example demonstrates how to store the text description for the elements.
In the solution shown below, you will see that the store text description is visible in HICC using the storeContentDescription command.
Content description is an attribute that is present for graphical elements in the mobile app to provide some context to them which might otherwise not be available due to their non-text nature. This is listed as ‘accessibility-id’ in Appium if
- For Android devices, the element has a ‘content-desc’ attribute.
- For iOS devices, the element has a ‘name’ attribute.
Solution:
# | Command | Target | Value |
---|---|---|---|
Store the content description text for the income image | |||
1 | storeContentDescription | id=com.eureqa.eureqaprod:id/image2 | imageContentDesc |
Tips, Tricks, Gotchas & Best Practices:
- The content description can be further verified by using verifyContentDescription assertContentDescription and waitForContentDescription commands.