TestProject Forum
Powered by leading experts in the test automation community

Tap on the upload GIF within the App is not working

Hi,

How can I tap on the Element to open the giphy screen within the App?

I have tried using the following:

Type - Element Action
Element - XCUIElementTypeOther using the XPATH
Action- TAP

But its not working. Also, I have tried using Type as Action, select type as Tap/upload and many other but I am not able to Tap to open the GIPHY screen to select one within the App.

Never mind , Its resolved.

Hello @siwangishah,
May I ask how it was resolved so the entire community and us will know what you did?
Thank you.

Yea sure, so earlier I tried to locate the element directly by tapping double shift on the element in the app to get the XPATH but it selected the child element’s XPATH & as the name of the element type is almost same for the child/parent so it didn’t worked.
Element type - XCUIElementTypeOther
Later, I tried using element locator button (top right on the platform) and located the element and selected the parent element type - It worked.
element type - XCUIELEMENTTYPEOTHER5

What I learned: just by tapping double shift on the element doesn’t work to get the accurate XPATH so try element locator.

Also, a question for you - Is there any trick to get the element name/id/Xpath easily? as I am still stuck on some other areas where if I run the single test at a time - the located element works but if I combine 2 tests and place it in the job - it doesn’t work & the element just above the located element is being selected.

We can try to locate the element by its element or if he contains text or something, you can send here the attributes of this element, so I could try to configure a better locator for you

1 Like

Hey,

I am stuck on locating elements by its XPATH and now even element Explorer/locator is not helping me out :frowning:

These are the XPATH for the element that I want to locate:

  1. The Parent element XPATH which I got from element explorer:

//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeCollectionView[1]/XCUIElementTypeCell[1]/XCUIElementTypeOther[1]

  1. I got this from the Element locator which is child element :

//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeCollectionView[1]/XCUIElementTypeCell[1]/XCUIElementTypeOther[1]

  1. This is the XPATH that I got after tapping double shift on the element:

//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeCollectionView[1]/XCUIElementTypeCell[1]

But instead of selecting the first cell of the page(above given XPATH), it selects the 4th cell whose XPATH is:

//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeCollectionView[1]/XCUIElementTypeCell[4]/XCUIElementTypeOther[1]

Also, there is no there attribute for these elements except XPATH & coordinates.

I see, so what you can do is either:

  1. Use the tap with coordinates action and give it the coordinates that you need
  2. Use the tap on relative point, giving any element that this button is present on, and in the parameters, for example input of 0 in vertical and 100 in horizontal so it will point to the top right, and if it will not work you can try to change the inputs

    3.If none will help you can find us on the bottom right orange icon, and we can continue to troubleshoot it
    image