← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #231037]: using the find() to pass in a parameter?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
A GUI element (like you do it manually) needs to get the focus, before
entering anything, if  it does not have the focus yet (as in your case).

So you need a click action before pasting.

So you could either do:
find(<image>)
paste(getLastMatch(), "some text") # paste does a click before pasting

or 
find(<image>)
click(getLastMatch()) # explicit click
paste("some text")

or (most compact ;-)
paste(<image>, "some text") # paste does find, click and paste

In all cases, the <image> must define a target offset, so the field is
activated.

BTW: 
With Sikuli it always is a temptation, to first think about the visual approach.
But in some cases using the keyboard instead might be more robust, especially if some shortcut is available.

In this case using ctrl+l (lowercase L, cmd+l on Mac)) works for all
browsers to select the address bar.

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