← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #152680]: How to clear the text field value in Iphone simulator

 

Question #152680 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/152680

    Status: Open => Answered

RaiMan proposed the following answer:
OK, on Mac we face the "app needs focus" problem:

A click or a key press from Sikuli is only accepted by the app, if the
respective window has the focus (is frontmost and active).

So if you run a Sikuli script, you have to actively switch focus to the
app you want to automate (in your case the emulator window).

Have a look at the App class, which works really fine on Mac.

I'm just looking in parallel with Xcode 4 and iPhone Simulator ;-)

This clicks the Settings button on Home:
ai = App("iPhone Simulator")
ai.focus()
aiw = Region(ai.window())
aiw.highlight(2)
aiw.click(<image of settings button>)

So in your case, before using the type() sequence, you have to activate
the respective input field, so it accepts the keystrokes.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.