Explore View Tree is a feature that is designed to help you discover all the visible elements of your mobile application while developing your test scripts. It captures a snapshot of the user interface and allows you to navigate and explore the view objects of your native apps.
Explore View Tree feature allows you to see, debug, analyze or determine the state of individual View components. It also informs you about global changes in the view tree.
This feature CANNOT be used as Appium Inspector. If you want to use Appium Inspector with Sauce, see the Appium Inspector project in GitHub. Such global changes include, for example, a layout of the whole tree.
The feature speeds up your debugging experience of QA SDET for automated test scripts, and expedites the debugging and validating View and UI-related issues. Finally, the Explore feature is a critical factor for easy validation of accessibility labels.
What You'll Need
- A Sauce Labs account (Log in or sign up for a free trial license)
- A native Android, iOS, or iPadOS mobile app
Using Explore View Tree for Real Devices
By default, the Explore View Tree feature is enabled if the instrumentation feature is enabled.
To enable instrumentation:
- In Sauce Labs, from the left navigation, click App Management.
- Upload your mobile app.
- After you’ve uploaded your app, hover your mouse over your app, then select Settings.
- Under Real Device Settings, toggle Instrumentation to Enabled.
Now you can start your live or automated testing session. View Tree will be captured and be part of your test results.
The Explore View Tree feature works for all the automated test framework types.
Accessing Explore View Tree
In Sauce Labs, click LIVE or AUTOMATED and then click Test Results.
Select a test result from the list.
Click on Explore button.
The Explore View Tree feature will display the captured snapshots of detectable view changes:
You can also download the results using the API call below:
curl --compressed \
Explore View Tree Attributes
The following table lists the available attributes:
|ID||The class identifier|
|Visibility||A value that checks if the component is present in the View Tree|
|Focusable||A value that provides additional information associated with accessibility|
|Alpha||A value that describes how translucent or opaque the component is|
|Enabled||Checks the interactivity of the component|
|ContentDesc||The accessibility description of a UI component|
|Text||A text attribute of a UI component|
- Webviews and hybrid apps will have additional capture limitations.
- Emulators and Simulators are not supported.