WebElement using ByIosNsPredicate

Hi,

I was trying out click using findElementByIosNsPredicate() in the settings screen of IOS. But unfortunately it is not working and i am getting exception “Cannot find matching element locator to: -ios predicate string”

Below is my sample code

Open “Settings” screen in iPhone and do the below operation

		String text = "Mobile";

		WebElement element = aDriver.findElementByXPath("//UIATableCell[@name='Mobile']"); // Works
		element = aDriver.findElementByIosNsPredicate("name='" + text + "'");  // Fails
		element = aDriver.findElement(MobileBy.iOSNsPredicateString("name MATCHES  '" + text + "'")); //Fails

		element.click(); 

I will find the “Mobile” link in settings screen and click on it. Any help is appreciated.

Java-client : java-client-5.0.0-BETA5

@mathewkuruvila you are coding it wrong (Apple :slight_smile: ) - to read examples https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/ios_predicate.md

Thank you @Aleksei

I will go through the document