How do I select items for Frank using UIQuery / UISpec?

I am using Frank's automation tool to write iOS tests using cucumber. If I understand correctly, I can point to various UI elements using UIQuery selectors. I had a hard time finding documentation about these selectors. How exactly do they work?

In particular, right now I am trying to select UITextField

which inspector Symbiote Frank identifies as UITextField with label "UserName"

. I have explicitly set this ID with Xcode using the Labelibility property of the Label. I saw that by default Frank uses the placeholder property to refer to UITextField

, but I don't want to use it.


source to share

2 answers

This is a partial answer to a specific problem I had about how to access items using the accessibility label property. For UITextField

with the accessibility label set to UserName

, the selector "view marked: 'UserName'"

seems to work.

The more general question of how selectors work remains open.



Consider how to use Igor Query Language:

I modeled Igor after the CSS selectors and added some syntax to handle some situations that CSS doesn't handle (like "cousins" and choosing views based on the characteristics of their descendants).

Igor syntax for your request:


Igor's grammar is fully described in the wiki. The wiki also has a few examples, though probably not enough.



All Articles