Skip to content

[Android] TestID assigned to TextInput control not working #32969

Open
@anchitkoul

Description

@anchitkoul

Description

Adding TestID on Android platform to TextInput does not show up in Appium Inspector or Appium tests.

"react": "^16.12.0",
"react-native": "^0.64.3",

Appium Doctor v.1.15.3

Version

16.12.0

Output of npx react-native info

System:
OS: macOS 10.15.7
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 36.09 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 16.2.0 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 7.13.0 - /usr/local/bin/npm
Watchman: 2021.11.08.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK:
API Levels: 30
Build Tools: 28.0.3, 29.0.3, 32.0.0
System Images: android-30 | ARM 64 v8a, android-30 | Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom_64
Android NDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7935034
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_292 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: ^0.64.3 => 0.64.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. Add Test ID to TextInput component
  2. Open app on Android Emulator
  3. Open Appium inspector to inspect this component / Write Appium test to inspect this component

Expected: testID value should be present in ID attribute of the component.
Result : testID value is not present in ID attribute

import { TextInput } from 'react-native';

<TextInput
      testID={item.testID}
      editable={!disabled}
      maxLength={maxLength}
      accessibilityLabel={ariaLabel}
      onChangeText={onChangeText}
      selectionColor={colorMapping.blue}
      style={[composedStyle.textbox, isiOS && !innerLabel ? {} : innerLabelBorderStyle]}
      underlineColorAndroid='transparent'
      onFocus={onFocus}
      onBlur={onBlur}
      value={value}
      accessibilityLabel={ariaLabel}
 />

Snack, code example, screenshot, or link to a repository

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions