I'm working on testing an iOS app with Calabash, and ran into the problem where the command scroll 'UIScrollView', :down
scrolls down the wrong view, since the first view it finds is a UIPageViewController, not the scrollview inside it.
Is there any way I can distinguish between the two views? The basic UIScrollView doesn't have a custom class, and I don't want to create one just for the sake of testing. Any other options? I can't find anything useful in the calabash docs.
Cheers!
Calabash queries support looking up by index. This approach is fragile, as the query depends on other views than the one you are looking for to correctly determine which view to match. A change in the rest of your UI could cause these queries to break.
However, if you have no unique identifier, using index is absolutely correct and not a bad solution, you should just be cautious.
query("UIScrollView index:1") will select the second UIScrollView. The query syntax is identical for all the gestures.