views:

117

answers:

1

Using

UIATarget.localTarget().frontMostApp().logElementTree;

when I know that there is a keyboard present (after tapping a text field) shows that there is a UIAKeyboard element in the hierarchy. However, it does not have a name. I'd like to get a ref to that so that I can dismiss it from the script. My best guess is to use something like:

UIATarget.localTarget().frontMostApp().elements().firstWithPredicate("Class like UIAElement");

but I can't figure out the correct predicate string format. If you guys know a better way, please guide me.

A: 

See UIAApplication.keyboard():

Returns the UIAKeyboard object representing the application’s keyboard, if it exists.

Example I'm using to select 'Go':

var app = UIATarget.localTarget().frontMostApp(); app.keyboard().elements()["go"].tap();

gorbster