-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] TestID assigned to TextInput control not working #32969
Comments
Anyone by chance have a workaround for this? We are suffering from the same problem. |
Hey guys, I am faced with the same problem? Any progress on this? |
Also experiencing this same issue. |
is someone looking into this issue? |
I think using UIAutomator2 or Espresso for Appium on Android won't be able to set ID even if you set |
Thats exactly the reason we don't want to use accessibilityLabel , our organization takes accessibility very seriously |
Actually there is a commit related to this issue but I didn't test it. I think with RN version |
has anyone seen it working in 0.65+ version? |
No, although if you give your testid a globally unique name it can: |
on v0.66, |
Same here, any workarounds? |
PR #31865 was supposed to fix this but I'm not having any luck on RN 0.70.5 |
Did you try a globally unique test id? because on Android you need it to be unique, #32969 (comment) . Does it still not work with that? |
@brett-james-rocketlab Thanks for your reply. I did see your comment and I thought After running the test, I got the message
I'm trying to test using firebase-test-lab rather than one of the other tools mentioned in this thread. I just tried something closer to the exact format you mention in your example: So I'm not sure how to make it globally unique, if that's what the problem is. |
@chetstone Ok you sound like you've done all the right things there then. What you can also do is launch appium + appium inspector (it can take a bit to setup - the. goal is to be able to see a representation of what your app is rendering): |
Suffering from the same problem. |
Suffering for the same problem, but also for View's, TextInputs etc |
Unused text input: no resource name matched the regex "email" not work too |
anyone tested this in |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This would be good to see resolved. I'll try spin up a v0.76.x build this week - fabric renderer might make this more tricky. Since I first filed this, I moved from Appium, to Maestro Studio for testing because its much more flexible at handling this. |
I'm trying to tackle the different issues related to the With the following code, I see it works for both cases when the testID is repeated and also when it is unique. import {TextInput, StyleSheet} from 'react-native';
function Playground() {
return (
<>
<TextInput testID="playground_text_input" style={styles.textInput} />
<TextInput testID="playground_text_input" style={styles.textInput} />
<TextInput
testID="playground_text_input_different"
style={styles.textInput}
/>
</>
);
}
const styles = StyleSheet.create({
textInput: {
height: 40,
borderColor: 'gray',
borderWidth: 1,
margin: 10,
},
}); Screenshots: Seems like something got fixed since this was first reported. I think we could close it this one, unless somebody can confirm it is still happening and can provide a minimal repro using the latest RN version. Then I'd be happy to troubleshoot it |
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
Expected: testID value should be present in ID attribute of the component.
Result : testID value is not present in ID attribute
Snack, code example, screenshot, or link to a repository
No response
The text was updated successfully, but these errors were encountered: