-
-
Notifications
You must be signed in to change notification settings - Fork 12
Flutter Inspector
Sai Krishna edited this page Jul 11, 2024
·
1 revision
The Flutter Inspector is an essential tool in the Appium Flutter integration driver for identifying UI elements.
-
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.
- Connect your device and run your app using
-
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=/
). - Click on Flutter Inspector from the header tab to see the application tree.
- Click on "Select Widget Mode" and select the element on the device. Navigate to "Widget Details Tree" to see information about the element.
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."
The inspector simplifies locating elements for automation testing, ensuring accurate and efficient test script creation.