question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to find displayedElement and visible is false even when it is true.

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hokyunghcommented, Dec 26, 2019

@KazuCocoa It works with simpleIsVisibleCheck on Appium Desktop. Is this supposed to be the recommended way? Thanks for the solution though!

0reactions
vzenzocommented, Jun 2, 2021

This still does not work at all, even with “simpleIsVisibleCheck” set to true

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I catch whether the element is not visible
try: element = //find your element if element.is_displayed(): return True else: raise AssertionError except Exception: return False.
Read more >
APPIUM IOS - Check if element exist on screen - Issues/Bugs
see when you did boolean displayed=element.isEnabled(); then it assign the value true or false now you need to compare and for compare we...
Read more >
The element is not clicked if the element is not visible on the ...
Any way to check if it is not displayed, because ele.isDisplayed() returns true. Edit : It is the problem with Internet Explorer only...
Read more >
visible false control can not find by javascript - MSDN - Microsoft
now depends upon the user's input, i make the panel visible=true, and in that panel has usercontrol in which i written javascript,. but...
Read more >
Button Visible is "False" but element visible and clickable
In the iOS (10.2.1) button is visible in UI, but in Ranorex Spy element has ... [RanorexSpy] Check visibility property - it is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found