Loading...
Loading...
Adding stable accessibility identifiers for screenshot automation across all frameworks. Covers Flutter, SwiftUI, UIKit, Jetpack Compose, XML Android, and React Native. Naming conventions, common widget patterns, and verification strategies.
npx skill4agent add truongduy2611/app-screenshots-cli-skills appshots-accessibility-ids| Without identifiers | With identifiers |
|---|---|
| Tap by coordinates → breaks on different screens | Tap by |
| Tap by text → breaks across locales | Identifiers are locale-independent |
| Need trial-and-error | Predictable, documented targets |
Semantics(
identifier: 'settings_button', // ← stable, locale-independent
child: ElevatedButton(
onPressed: () => openSettings(),
child: Text(context.l10n.settings), // ← localized, changes per locale
),
)was contributed by the Maestro team in Flutter 3.19.Semantics.identifier
Button("Settings") {
openSettings()
}
.accessibilityIdentifier("settings_button")button.accessibilityIdentifier = "settings_button"Button(
onClick = { openSettings() },
modifier = Modifier.semantics { testTag = "settings_button" }
) {
Text(stringResource(R.string.settings))
}In Compose, useinsidetestTag— Maestro matches this asModifier.semantics { }.id:
<Button
android:id="@+id/settings_button"
android:contentDescription="@string/settings"
android:tag="settings_button" />Maestro usesas theandroid:tagselector for XML views.id:alone is not enough.android:id
<TouchableOpacity
testID="settings_button"
accessibilityLabel="Settings"
onPress={openSettings}
>
<Text>{t('settings')}</Text>
</TouchableOpacity>React Native useswhich maps directly to Maestro'stestIDselector.id:
context_element# Navigation
tab_home
tab_search
tab_profile
tab_settings
# Feature cards / buttons
feature_camera
feature_scan
feature_create
# List items (indexed)
list_item_0
list_item_1
search_result_0
# In-screen actions
login_submit_button
onboarding_next_button
dialog_confirm_buttonsettings_buttonSettingsButtonlist_item_0search_result_0tab_homebottom_navigation_bar_home_tab_buttonmaestro studioaxe describe-ui --udid <SIMULATOR_UDID>
axe describe-ui --udid <SIMULATOR_UDID> | grep "settings_button"| Framework | Debug tool |
|---|---|
| Flutter | |
| SwiftUI/UIKit | Xcode Accessibility Inspector |
| Android | Layout Inspector → Accessibility pane |
| React Native | Appium Inspector or |
maestro studioaxe describe-uiandroid:idandroid:tag