TestProject Forum
Powered by leading experts in the test automation community

Clicking on a coordinate is not working

Hi,

i wanted to click on an XCUIElementTypeImage element. And I have found the x and y coordinates using the get location action. Then i am using the tap gesture at coordinates action to click on that area which is a checkbox in the ios app. But unfortunately it is not clicking on the required area though the coordinates are correct.

Screenshot 2020-08-17 at 16.01.01

Hello @lipson.augustine
Instead of clicking with coordinates, you can just capture the element in the recorder and click on it.
Is there any specific reason you are using the coordinates?

When i turn on the recorder and click, the checkbox is not getting checked. But it is getting clicked from emulator when the recorder is off.

You can try using the element explorer to find the checkbox manually, and then try to click it.
It could be you are not clicking on the correct element with the recorder, maybe some wrapper element.

There are multiple similar elements and i have created a relative xpath for identifying. Though its detecting while evaluating the element, at run time it is not getting clicked.

Can you send a screenshot of the entire recorder window please.

Element state is invalid (obscured by another element or invisible): ElementNotVisibleException: Element is not visible

This is the error i am getting while passing the click action.

Is the element visible while you are trying to click it?
If it’s not, you can use one of the swipe actions we have to that element, before you click it.

Yes. It is completely visible. I am already swiping down

Can you please send a screenshot of the entire recorder window, it will help.

It is difficult for me to send a screenshot publicly due to data policy of the app

You can blur the application part, I want to check if the application you are testing is Hybrid or native IOS.

app is a hybrid one but i am automating only the native part of it

Element state is invalid (obscured by another element or invisible): ElementNotVisibleException: Element is not visible

could you tell me the reason for this error message. In the error screenshot, the specified element is clearly visible