Unable to find displayedElement and visible is false even when it is true.
See original GitHub issueThe problem
Briefly describe the issue you are experiencing (or the feature you want to see added to Appium). Tell us what you were trying to do and what happened instead. Remember, this is not a place to ask questions. For that, go to http://discuss.appium.io!
Environment
- Appium version (or git revision) that exhibits the issue: 1.16.0-beta.3
- Last Appium version that did not exhibit the issue (if applicable): N/A
- Desktop OS/version used to run Appium: macOS 10.14.6
- Node.js version (unless using Appium.app|exe): 10.17.0
- Npm or Yarn package manager: 6.4.1
- Mobile platform/version under test: iOS 12.4
- Real device or emulator/simulator: Real Device IPhone 6s plus
- Appium CLI or Appium.app|exe: Appium Desktop
Details
If necessary, describe the problem you have been experiencing in more detail. In the appium Desktop it is able to inspect the element, but with class chain I was not able to find out with
**/XCUIElementTypeButton[`name == "Cancel" AND visible == true`]
Even though the inspector says it is true. However, I was able to find the element with
**/XCUIElementTypeButton[`name == "Cancel" AND visible == false`]
See the attached screenshots inspector class chain query true not found class chain query false elements found
Link to Appium logs
[BaseDriver] Waiting up to 0 ms for condition
[WD Proxy] Matched '/elements' to command name 'findElements'
[WD Proxy] Proxying [POST /elements] to [POST http://localhost:8100/session/B4F14AD1-EB54-47CE-B41D-0CFE5B17AD48/elements] with body: {"using":"class chain","value":"**/XCUIElementTypeButton[`name == \"Cancel\" AND visible == true`]"}
[Xcode] t = 3757.87s Get all elements bound by accessibility element for: Elements matching predicate '(wdName == "Cancel" AND isWDVisible == 1) AND (1 == 1 OR identifier == 0 OR frame == 0 OR value == 0 OR title == 0 OR label == 0 OR elementType == 0 OR enabled == 0 OR placeholderValue == 0)'
[Xcode]
[Xcode] t = 3757.88s Requesting snapshot of accessibility hierarchy for app with pid 52
[Xcode]
[Xcode] t = 3758.10s Find: Descendants matching type Button
[Xcode]
[Xcode] t = 3758.11s Find: Elements matching predicate '(wdName == "Cancel" AND isWDVisible == 1) AND (1 == 1 OR identifier == 0 OR frame == 0 OR value == 0 OR title == 0 OR label == 0 OR elementType == 0 OR enabled == 0 OR placeholderValue == 0)'
[Xcode]
[WD Proxy] Got response with status 200: {"value":[],"sessionId":"B4F14AD1-EB54-47CE-B41D-0CFE5B17AD48"}
[MJSONWP (d4297697)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/d4297697-f6aa-496a-8092-ace43d2642d0/elements 200 289 ms - 74
[HTTP]
Code To Reproduce Issue [ Good To Have ]
This is hard since I can’t share the app, but on certain places one of button is visible, but it is not able to find with that flag.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
@KazuCocoa It works with simpleIsVisibleCheck on Appium Desktop. Is this supposed to be the recommended way? Thanks for the solution though!
This still does not work at all, even with “simpleIsVisibleCheck” set to true