How to handle XCUITest 'visible' attribute?

Hello there,

I’m using Appium’s inspector (precompiled binary 1.5.3 for mac os) properly linked with an updated appium installation through npm (1.6).

So, since I’ve using XCUITest there are a new boolean property or attribute called ‘visible’ at Appium inspector.

This could be an inspected XCUITest element:

name: mytext
type: XCUIElementTypeStaticText
value: mytext
label: mytext
enabled: true
visible: false
valid: true
  • The visible attribute cannot be used as a condition in xpath expressions:
    //*[@visible='true' or @visible='false'] will never locate any element using inspector or java client code.
  • Appium inspector locator is able to locate non visible elements while programatically (java client in my case) you cannot locate non-visible elements with a findElements instruction. The following xpath would locate the element described above using Appium’s inspector but java-client findElement function throws a timeout exception: //*[@label='mytext']

How is the correct way to handle visible=false elements?

Thank you.

Hi Hamena,

I am also facing same issue , please provide the code if you resolve this issue.

Thanks in advance

Hi,

Any one have solution for this issue. Please tell me approach. It is blocker for me.

Thanks in advance.

Still not able to handle visible attribute.

@prasad or Appium community, did you found any solution?

hi.

if you want to see attribute value you need somehow find your element by any strategy and use getAttribute e.g.:

driver.findElement(MobileBy.id(“accesibility_ID”)).getAttribute(“visible”);
//or
driver.findElement(MobileBy.id(“accesibility_ID”)).getAttribute(“value”);

Hello hamena,

I am able to perform action on invisible elements using Appium 1.6.3

Thank you all, I’ll try Appium 1.6.3.

Hello @prasad,

I tried on Appium 1.6.3 and invisible elements still unreachables for me.

Any suggestions? Nobody needs to interact ‘invisible’ elements?

Hi @hamena, did you resolve this issue?
For some ‘invisible’ elements, I can find them and click on the elements, but still cannot find and click on some ‘invisible’ elements. I do not know the reason
Hope you can give me some advice

I have the similar problem, dose any one has the solution?

the same isue on appium 1.6.5 and ios11. how to solve it?