Skip to content

Instantly share code, notes, and snippets.

@jonathanpenn
Created September 27, 2012 04:58
Show Gist options
  • Save jonathanpenn/3792241 to your computer and use it in GitHub Desktop.
Save jonathanpenn/3792241 to your computer and use it in GitHub Desktop.
Using to-many predicates with UIAutomation
// Based on this discussion:
// https://twitter.com/listrophy/statuses/251074683594747904
// To setup:
// Create an application that has a tableView with a couple cells in it, one of
// which has the "coffee" in it's label
var target = UIATarget.localTarget();
var app = target.frontMostApp();
var window = app.mainWindow();
var stuff = window.elements().firstWithPredicate("ANY cells.name like 'coffee'");
// `stuff` now contains the *tableView* that has any cells with name like 'coffee'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment