as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support

Inspect Your App with Appium Inspector

Appium Inspector is a companion tool for Appium that helps in writing reliable automated test scripts for native, mobile, and hybrid apps. It lets you view an app's screen and page structure, exposing the underlying UI elements and properties.

Appium Inspector is a free, open-source tool hosted on GitHub. It provides visibility into an app's UI, allowing you to:

  • Inspect the app's screen and page structure
  • Select UI elements and view their properties
  • Use XPath expressions to search for elements
  • Trigger actions like clicking on selected elements
  • Record scripts for automated testing

Prerequisites

Make sure you complete the steps in Install Appium for Vega Integration.

Inspect your app

  1. Connect your device:

    Fire TV Stick:

    kepler exec vda connect <DEVICE_IP>
    

    Copied to clipboard.

    kepler exec vda devices
    

    Vega Virtual Device:

    Copied to clipboard.

    kepler virtual-device start
    
  2. Start the automation toolkit:

    Copied to clipboard.

    touch /tmp/automation-toolkit.enable
    
  3. Run the Appium Server:

    Copied to clipboard.

    appium
    
  4. Launch the Appium Inspector:

    On Mac: Open from Applications folder or Spotlight search

  5. Add capabilities.

    Learn about required capabilities in Manage Appium Sessions.

  6. Click the Start session button to start the Appium Inspector.

    Appium Inspector interface showing capabilities configuration panel with Start Session button highlighted
    Appium Inspector capabilities setup with Start Session button

    Appium Inspector obtains a screenshot of the displayed content on your device and shows the XML source in the App Source panel.

    Appium Inspector main interface showing device screenshot on left and XML App Source panel on right with UI element tree structure
    Appium Inspector session displaying app screenshot and XML source

    To update the displayed content, click the Refresh Source and Screenshot button.

Other functionalities

Select an element

In the App Source panel, select an element from the displayed XML tree.

Appium Inspector showing selected UI element highlighted in screenshot with corresponding element properties and actions displayed in Selected Element panel
Selected element with properties and available actions displayed

The page displays the element properties and available actions in the Selected Element panel.

Use xpath expressions to search for elements

Appium Inspector suggests a XPath selector with an id for the selected element. However, id values can be dynamic. Instead, use the test_id attribute or other attributes like role or description for more reliable element selection.

Appium Inspector search panel showing XPath expression input field with suggested selector and Search button for element location testing
XPath search functionality for locating UI elements

Examples of valid xpath expressions

  • //*[@role="button"] to get all the elements containing role="button" attribute.
  • //*[contains(@description, "Music")] to get all the elements containing Music in the description attribute.

To test your xpath expressions, use the Search button.

Trigger a click

To trigger a click on the selected element, use the Tap icon.

Appium Inspector interface highlighting the Tap icon button used to trigger click actions on selected UI elements
Tap icon for triggering click actions on selected elements

Record a script

Appium Inspector lets you record a script based on your interactions with the app:

  1. Launch Appium Inspector and connect to your device.

  2. Click the Record icon in the top bar to start recording.

    Appium Inspector recording interface showing Record button in top bar and generated script panel displaying captured user interactions for automated testing
    Script recording functionality capturing user interactions
  3. Perform the necessary actions:

    In the Search for Element panel, perform actions like locating elements and interacting with them using the Tap icon. The script area displays all your actions while recording is ongoing.

  4. Reclick the Record icon to stop recording.

    Use the generated script as a starting point for your automated tests or modified as needed. In the example, the sampleTest method captures the recorded actions.

    To change the script's recording language, use the drop-down menu in the Recorder panel's top-right corner.

Troubleshooting

If you encounter an issue, please provide the details in community.amazondeveloper.com.


Last updated: Sep 30, 2025