Elements visible on appium desktop but can't interact with them

Hi all,

I’m experiencing the following issue with appium and a react native app.

1º I locate some elements using appium Desktop (1.19.1)

ie:
@iOSXCUITFindBy(accessibility = “KnowTheApp_1_Card”)
@AndroidFindBy(accessibility = “KnowTheApp_1_Card”)
public MobileElement Know_The_App_1_Card;

2º Once I try to run my test and interact with those elements:

  • Android: Works properly
  • iOS: Can’t locate the element (It happen with more than one element on my app but not all of them)

After trying to run my test several times (always getting the same error, element is not visible) I get the elemet from the source page show as follow:

  • XCUIElementTypeOther type=“XCUIElementTypeOther” name=“KnowTheApp_1_Card” enabled=“true” visible=“false” x=“20” y=“223” width=“312” height=“434” index=“0”

I wonder If the tag “visible=false” has something to do with that.

Can you please help me to solve this issue?
KR,

  1. make sure that no any other element with same id available.
  2. check that this element indeed visible
  3. all fine but still tap fails due to visibility problem -> move to tap using element coordinate instead for this element.

Hi @Aleksei, first of all, thank you ever so much for your reply, I really apreciate it!

Secondly…:

  1. Yes, there is no other element with the same id
  2. Yes, the elements are visible, I meant It’s no necesary to scroll to see them or something similar.
  3. Unfortunately I’d say it’s not possible for us due to we need to verify the same element on different devices

Let me attached two screenshot to see it more clearly please.

Both screenshot related to the same element mentioned above

  1. The first one, If we locate the element with the parameteres given, It’s work fine for us

  2. Same element, If we take the accesibility Id, once we run our test the element is not locate with these parameters given (same parameter work properly for Android.- Accesibility Id)

why not possible tap by x,y? you just get element location and tap on it center using x,y coordinates. this will work on ANY phone.

int x = el.getCenter().x;
int y = el.getCenter().y;
// now tap by x,y

Ahh!! ok ok, I didn’t get you! Sorry It was my fault.

But, just in case, do you have any idea why It doesn’t work properly in iOS?? Do you know if the tag ‘visible or not’ has anything to do with that?

Thanks you so much @Aleksei

this is iOS staff which often works not nice. nothing we can do. problem in XCUITest framework itself.

1 Like

Perfect @Aleksei!! As I typed you before, THANKS YOU EVER SO MUCH!!