Element identification issue

I have been trying to click the attached highlighted (in red arrow) icon from IOS using Appium but keep getting timeout exception. This click is required against only the record of ‘193930 Copy 1’ in a table. Any assistance?

Appium: 1.6.2
XCode: 9.4
Tested in?: Native App
IOS: 11.4
Model: iPhone X



org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of element located by By.xpath:

//XCUIElementTypeStaticText[@name=‘193930 Copy 1’]/XCUIElementTypeButton[contains(@name, ‘more’)]

(//XCUIElementTypeStaticText[@name=‘193930 Copy 1’])/following-sibling::XCUIElementTypeButton[@name=‘more’]

//XCUIElementTypeStaticText[@name=‘193930 Copy 1’]/XCUIElementTypeButton[`name == “more”’]

//XCUIElementTypeStaticText[contains(@name,‘193930 Copy 1’)]/following-sibling::XCUIElementTypeButton

//XCUIElementTypeStaticText[contains(@name,‘193930 Copy 1’)]/XCUIElementTypeButton

Can you share Appium logs ?

Also, xPath is slow, So why don’t you try iOS predicate for finding more button .

Without PageFactory:
driver.findElement(MobileBy.iOSNsPredicateString(“type==\“XCUIElementTypeButton\” and name==\“more\””)).click();

With PageFactory:
@iOSXCUITBy(iOSNsPredicate=“type==\“XCUIElementTypeButton\” and name==\“more\””)
public MobileElement moreButton;

And can you also try to find this more button in Appium Desktop through search for element functionality.

1 Like

Check if the visible tag is showing as True in the Appium inspector for the button which you are trying to access.

1 Like