Skip to content

Flutter Inspector

Sai Krishna edited this page Jul 11, 2024 · 1 revision

Flutter Inspector

The Flutter Inspector is an essential tool in the Appium Flutter integration driver for identifying UI elements.

Steps to Use Flutter Inspector

  1. Run Your Flutter App

    • Connect your device and run your app using flutter run. Once the app builds, you should see an inspector debug URL in your terminal. image
  2. Access Inspector URL

    • Note the debug URL provided in the terminal.
    • Open the URL in your browser (e.g., http://127.0.0.1:9102?uri=http://127.0.0.1:62526/ntjLFgTSVH4=/). image
    • Click on Flutter Inspector from the header tab to see the application tree. image
    • Click on "Select Widget Mode" and select the element on the device. Navigate to "Widget Details Tree" to see information about the element. image

Locator Strategies

Use the Flutter Inspector to identify elements using:

  • text
  • semantics label
  • type
  • key

Consider the login button from the image:

  • For element by text, use the value from "Text," which is "Login."
  • For element by semantics label, use the value from the label under "Semantics."
  • For element by type, use the value "ElevatedButton."
  • For element by key, use the value "LoginButton."

Benefits

The inspector simplifies locating elements for automation testing, ensuring accurate and efficient test script creation.

Clone this wiki locally