TestProject Forum

Ios App with Object Type as XCUIElementTypeOther

Hi Team,
Need to perform click/tap action on object with Type XCUIElementTypeOther in an ios app.![image|478x380](upload://moJNWml1dwNGHrAVimage G31G4tw0NZ0.png)

Absolute xpath is never prefered for automation. (Highlights correctly)
But even Object Locator used as absolute xpath / Record and playback also fails to click/tap with below error :
Message

Action failed using following locators:

  1. XPATH=//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeWebView[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther[1]/XCUIElementTypeOther[37]/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther[1]
    TimeoutException: Timeout occurred while trying to perform the action. Element state is invalid (obscured by another element or invisible): ElementNotVisibleException: Element is not visible
    Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
    System info: host: ‘QKNBK942’, ip: ‘192.168.29.23’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘13.0.1’
    Driver info: driver.version: unknown

Please help to suggest how can this be handled.

Hello @seemak
Do the elements hold and static values?
Or does any parent element has them?
If they do, you can use them to capture the element without having to use the entire absolute path.
This error can come if you have multiple elements corresponding to, and the one which is captured is obscured by another element.

Hi,
It does not have any static values or children/parent objects.

Hey @seemak,

As we discussed earlier,
For tapping on obscured elements and in cases where you might need to tap on a specific part of a mobile element (both Android or iOS), you can use the Tap element at relative point action.

You can hover the wrapper element of the element you want to tap on, double shift to capture it, and select the “Tap at relative point” action, by providing the Horizontal tap percentage and the Vertical tap percentage (notice: it starts from the top-left corner of the element) you will be able to tap on a specific point on the wrapper element.

Here you can read more about it and find an example:
https://docs.testproject.io/testproject-addons/available-addons/element-extensions-addon