@vijay.alapati you are lucky today for iOS:
public boolean tapItemByDescription(String text) {
System.out.println(" tapItemByDescription(): " + text);
// scroll to object
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap scrollObject = new HashMap<>();
scrollObject.put("predicateString", "value == '" + text + "'");
js.executeScript("mobile: scroll", scrollObject);
// tap object
WebElement el = ((IOSDriver) driver).findElementByIosNsPredicate("value = '" + text + "'");
return tapElement((MobileElement) el); //tapElement just custom implementation. you may choose any way.
}
// example of some other predicate string which we can use in above example:
@iOSXCUITFindBy(iOSNsPredicate = "type == 'XCUIElementTypeStaticText' AND name == 'Change profile name'")
private List<IOSElement> changeProfileNameDialogHeader;