# How use semantic labels in appium flutter

**URL:** <https://discuss.appium.io/t/how-use-semantic-labels-in-appium-flutter/45772>\
**Category:** Support\
**Created:** [May 19, 2025, 12:45pm UTC](https://discuss.appium.io/t/how-use-semantic-labels-in-appium-flutter/45772 "2025-05-19T12:45:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emmanuel\_Anokye](https://discuss.appium.io/user_avatar/discuss.appium.io/emmanuel_anokye/32/14189_2.png) [@Emmanuel\_Anokye](https://discuss.appium.io/u/Emmanuel_Anokye)\
**Post date:** [May 19, 2025, 12:45pm UTC](https://discuss.appium.io/t/how-use-semantic-labels-in-appium-flutter/45772/1 "2025-05-19T12:45:09Z")

</div>

I want to trigger interactions on my widgets through their semantic labels but for some reason appium isn’t able to identify the semantic labels on the widgets. The semantic labels are visible in the FlutterWidget inspector though so i can’t figure out why its not able to find it. Any help??

---

<div class="post-metadata">

**Author:** ![wreed](https://discuss.appium.io/letter_avatar_proxy/v4/letter/w/919ad9/32.png) [@wreed](https://discuss.appium.io/u/wreed)\
**Post date:** [May 19, 2025, 3:29pm UTC](https://discuss.appium.io/t/how-use-semantic-labels-in-appium-flutter/45772/2 "2025-05-19T15:29:46Z")

</div>

> [@Emmanuel\_Anokye](#):
>
> appium isn’t able to identify the semantic labels on the widgets

What driver? There are currently 2 Flutter drivers available:

> **[GitHub - appium/appium-flutter-driver: Appium Flutter Driver is a test automation tool...](https://github.com/appium/appium-flutter-driver)**
>
> Appium Flutter Driver is a test automation tool for Flutter apps on multiple platforms/OSes. Appium Flutter Driver is part of the Appium mobile test automation tool maintained by community

> **[GitHub - AppiumTestDistribution/appium-flutter-integration-driver](https://github.com/AppiumTestDistribution/appium-flutter-integration-driver)**
>
> Contribute to AppiumTestDistribution/appium-flutter-integration-driver development by creating an account on GitHub.

And there are use cases for both Xcuitest and Uiautomator2:

> Since Flutter 3.19, Flutter apps can expose [`identifier` for `SemanticsProperties`](https://api.flutter.dev/flutter/semantics/SemanticsProperties/identifier.html) as `resource-id` in Android and `accessibilityIdentifier` in iOS.

Whichever one you are using, you might want to try one of the others as suits your needs best.

---

<div class="post-metadata">

**Author:** ![Emmanuel\_Anokye](https://discuss.appium.io/user_avatar/discuss.appium.io/emmanuel_anokye/32/14189_2.png) [@Emmanuel\_Anokye](https://discuss.appium.io/u/Emmanuel_Anokye)\
**Post date:** [May 19, 2025, 5:05pm UTC](https://discuss.appium.io/t/how-use-semantic-labels-in-appium-flutter/45772/3 "2025-05-19T17:05:15Z")

</div>

> [@wreed](#):
>
> [GitHub - AppiumTestDistribution/appium-flutter-integration-driver](https://github.com/AppiumTestDistribution/appium-flutter-integration-driver)

I’m using the appium flutter integration driver. Trying to use it for end to end testing of the flutter app

---

<div class="post-metadata">

**Author:** ![wreed](https://discuss.appium.io/letter_avatar_proxy/v4/letter/w/919ad9/32.png) [@wreed](https://discuss.appium.io/u/wreed)\
**Post date:** [May 19, 2025, 8:34pm UTC](https://discuss.appium.io/t/how-use-semantic-labels-in-appium-flutter/45772/4 "2025-05-19T20:34:25Z")

</div>

I don’t know Flutter all that well, but could you be looking at this issue:

> <https://github.com/flutter/flutter/issues/151238>
>
> \### Steps to reproduce
> 
> Unable to find element by Semantics 
> 
> \### Expected resul…ts
> 
> Should be able to find element bySemanticsLabel
> 
> \### Actual results
> 
> No element is found
> 
> \### Code sample
> 
> \<details open\>\<summary\>Code sample\</summary\>
> 
> FileName - test.dart
> \`\`\`dart
> import 'package:appium\_testing\_app/main.dart';
> import 'package:flutter/cupertino.dart';
> import 'package:flutter\_test/flutter\_test.dart';
> import 'package:integration\_test/integration\_test.dart';
> void main() {
> IntegrationTestWidgetsFlutterBinding.ensureInitialized();
> 
> group('end-to-end test', () {
> testWidgets('tap on the floating action button, verify counter',
> (tester) async {
> // Load app widget.
> await tester.pumpWidget(const MyApp());
> // Finds the floating action button to tap on.
> final fab = find.bySemanticsLabel('username\_text\_field');
> print(fab.evaluate());
> List\<DiagnosticsNode\> nodes = tester
> .widget(fab)
> .toDiagnosticsNode()
> .getProperties();
> // Emulate a tap on the floating action button.
> await tester.tap(fab);
> for (DiagnosticsNode node in nodes) {
> print("Flutter - ${node.name} -\> ${node.value}");
> }
> // Trigger a frame.
> await tester.pumpAndSettle();
> });
> });
> }
> \`\`\`
> App Code
> \`\`\`
> Semantics(
> label: "username\_text\_field",
> key: const Key("username\_text\_field"),
> // textField: true,
> explicitChildNodes: true,
> container: true,
> child: TextField(
> decoration:
> const InputDecoration.collapsed(hintText: "Username"),
> controller: userNameController,
> ),
> ),
> \`\`\`
> 
> \</details\>
> 
> 
> Command Used to build the IPA 
> 
> \`\`\`
> flutter build ipa --release --export-options-plist=/Documents/ExportOptions.plist /Downloads/git/appium-flutter-server/demo-app/integration\_test/test.dart
> \`\`\`
> 
> \### Screenshots or Video
> 
> \<details open\>
> \<summary\>Screenshots / Video demonstration\</summary\>
> 
> \[Upload media here\]
> 
> \</details\>
> 
> 
> \### Logs
> 
> \<details open\>\<summary\>Logs\</summary\>
> 
> \`\`\`console
> {"msg":"Jul 3 19:22:35 God- kernel(AppleMobileFileIntegrity)\[0\] \\u003cNotice\\u003e: AMFI: constraint violation /private/var/containers/Bundle/Application/394C6BFC-9825-4665-A685-48F161BF8357/Runner.app/Frameworks/webview\_flutter\_wkwebview.framework/webview\_flutter\_wkwebview has entitlements but is not a main binary"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: 00:00 +0: end-to-end test tap on the floating action button, verify counter"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: Found 0 widgets with element matching predicate: \[\]"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: Bad state: No element"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: #0 Iterable.single (dart:core/iterable.dart:674)"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: #1 WidgetController.widget (package:flutter\_test/src/controller.dart:801)"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: #2 main.\\u003canonymous closure\\u003e.\\u003canonymous closure\\u003e (file:///Users/saikrishna/Downloads/git/appium-flutter-server/demo-app/integration\_test/test.dart:17)"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: \\u003casynchronous suspension\\u003e"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: #3 testWidgets.\\u003canonymous closure\\u003e.\\u003canonymous closure\\u003e (package:flutter\_test/src/widget\_tester.dart:183)"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: \\u003casynchronous suspension\\u003e"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: #4 TestWidgetsFlutterBinding.\_runTestBody (package:flutter\_test/src/binding.dart:1017)"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: \\u003casynchronous suspension\\u003e"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: #5 TestWidgetsFlutterBinding.\_createTestCompletionHandler.\\u003canonymous closure\\u003e (package:flutter\_test/src/binding.dart:809)"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: \\u003casynchronous suspension\\u003e"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: 00:00 +0: end-to-end test tap on the floating action button, verify counter \[E\]"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: Test failed. See exception logs above.\\n The test description was: tap on the floating action button, verify counter"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter:"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: 00:00 +0 -1: (tearDownAll)"}
> {"msg":"Jul 3 19:22:36 God- Runner(Flutter)\[66332\] \\u003cNotice\\u003e: flutter: 00:00 +1 -1: Some tests failed."}
> \`\`\`
> 
> \</details\>
> 
> 
> \### Flutter Doctor output
> 
> \<details open\>\<summary\>Doctor output\</summary\>
> 
> \`\`\`console
> \[Paste your output here\]
> \`\`\`
> 
> \</details\>

Looks like it can happen in debug builds too. I don’t see this as being currently fixed, unfortunately. Got it from the link you cited:

> ⚠ Testing on real iOS devices for `semanticsLabel` may not work due to an issue raised with Flutter. For updates and more information, please refer to [GitHub issue #151238](https://github.com/flutter/flutter/issues/151238).
