Hi,
I want to find some elements which share the prefix "pre " but has different suffixes.
i.e. elements ids are: "pre elem1" and "pre elem2".
I want to be able to find each of them separately.
Could someone give me a hand with this?
Thanks.
example with predicate:
@iOSXCUITFindBy(iOSNsPredicate = "type == 'XCUIElementTypeStaticText' AND name BEGINSWITH 'pre '") private List<IOSElement> yourList;
Thanks for the quick response,
How can I use without @iOS... ?
I mean something like that:
driver.findElement(By...)
@BB here your way:
driver.findElements(MobileBy.iOSNsPredicateString("type == 'XCUIElementTypeStaticText' AND name BEGINSWITH 'pre '"));
It doesn't seem to work...
It doesn't recognize ".iOSNsPredicateString"
Do you know what could be the reason for that?
your java-client version is OLD
Thanks a lot @Aleksei! I appreciate it.
Can we use ios_predicate with Ruby client?
My Java Client was up to date...
Can you tell me what to import?
mine java-client version:
<dependency> <groupId>io.appium</groupId> <artifactId>java-client</artifactId> <version>5.0.0-BETA8</version> </dependency>
to import it is:
import io.appium.java_client.MobileBy;
@gajeshwar try here - https://github.com/appium/sample-code/tree/master/sample-code/examples/ruby
Sorry, but I can't find anything related to ios predicate there.
@gajeshwar next try - see end https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/ios_predicate.md
Thanks for your help @Aleksei but that also didn't work with iOS 10.* usingAppium 1.6.4.
I am doubtful whethet we have added predicate support in newer ruby libraryor not.
@Aleksei ...What should I import to use : iOSXCUITFindBy ?
And maybe the reason I can't find those methods is that I use Java?
10x
@gajeshwar you need look into Appium logs to check how it sending with ruby.@BB
import io.appium.java_client.pagefactory.iOSXCUITFindBy;
Sorry but how can I check appium logs since I couldn't execute those commands at all.