Skip to content
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

testID, accessibilityLabel information not visible in Appium (Android only) #30226

Closed
varun-batta-vc opened this issue Oct 21, 2020 · 12 comments
Closed
Labels
Accessibility Team - Evaluated Needs: Triage 🔍 Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@varun-batta-vc
Copy link

Description

When inspecting a react-native app on Android via Appium, testing identifiers like testID or accessibilityLabel sometimes appear and sometimes don't. There is no major difference in how nested the elements are for when they appear and when they don't - they just sometimes don't. This is not an issue on iOS, everything works fine there.

Whether, as has been mentioned in various places, I put testID, testID & accessibilityLabel or just accessibilityLabel the issue is there. Whether or not I add the prop of accessible={true} or not, the issue is there.

React Native version:

    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 59.60 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 13.12.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
    Android SDK:
      API Levels: 26, 28, 29
      Build Tools: 28.0.3, 29.0.2, 29.0.3
      System Images: android-23 | Google APIs Intel x86 Atom, android-25 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 12.0.1/12A7300 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_265 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.2 => 0.63.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found```

## Steps To Reproduce
Create a react native app, set up tests via `jest` and `appium` (as can be seen in countless different places online) and simply provide the testing props on a view `testID`, `accessibilityLabel` and for the test use `driver.hasElementByAccessibilityId()` function.

## Expected Results
The element is found based on the accessibility information I provide. Tests may fail due to various other appium issues (namely the driver limitations on the Android side) but the elements should be found.

## Snack, code example, screenshot, or link to a repository:
Sample React-Native View:
```return (
      <>
          <View
            testID="container"
          >
            <Text testID="testText">Test</Text>
          </View>
      </>
    );```

Sample Test code:

expect(await driver.hasElementByAccessibilityId('container')).toBe(true);
expect(await driver.hasElementByAccessibilityId('testText')).toBe(true);

@ghost
Copy link

ghost commented Nov 13, 2020

There is a PR with a fix for this:
#29610

@TomH-e2x
Copy link

TomH-e2x commented Aug 5, 2021

Any update for IOS on this ?

@pranshuchittora
Copy link

Facing the same issue 0.64.2

@retyui
Copy link
Contributor

retyui commented Oct 6, 2021

⚠️ NOTE:

This problem is not actual starting from react-native@0.65.x, CHANGELOG:

Display the testID as the resource-id for black-box testing frameworks ( #381fb3 by @jdeff)

@stale
Copy link

stale bot commented Jan 9, 2022

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 9, 2022
@kopax-polyconseil
Copy link

We have the same issue and we are also trying to figure out the relation between those 3 props. It's hard to give a how to write end-2-end guide without knowing how they are related and impact each other.

Have you succeed ? This should be flagged as major bug btw.

@FeifanChang
Copy link

Same Problem.

@github-actions github-actions bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 24, 2023
@tobywisener
Copy link

Same problem... very frustrating

Copy link

github-actions bot commented Mar 6, 2024

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.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 6, 2024
@pranshuchittora
Copy link

Pls don't close until it is fixed. Thanks 🙌

@github-actions github-actions bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 7, 2024
@react-native-bot
Copy link
Collaborator

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.

@react-native-bot react-native-bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 3, 2024
@react-native-bot
Copy link
Collaborator

This issue was closed because it has been stalled for 7 days with no activity.

@react-native-bot react-native-bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility Team - Evaluated Needs: Triage 🔍 Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

9 participants