← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #160752]: Cannot make sikuli even go to yahoo from google

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
-- 1. click/wait/paste include a find operation
so based on your script it is sufficient to say:
click(image-of-start-button) # finds and clicks
wait(google-logo, 5) # give it some time to come up
paste(image-www.google.com, "www.yahoo.com")
type(Key.ENTER)

-- 2. comment on paste():
it searches the given image, clicks it to get the focus to an input field and finally makes the paste-operation (internally a ctrl-c is simulated using the clipboard)

so the center of the image you use with paste has to be inside an input
field that is intended to get the text input. You might use the preview
feature to adjust the clickpoint (target offset).

-- 3. timing
After e.g. a click() you might have to wait for the application to react (an example is the above wait()) and change the screen content. So your workflow has to take this into account.

-- 4. Searching vs. typing
It is really amazing, what you can do with the Sikuli image related features. But in many cases it is much easier and more robust if there is some keyboard action possible to achieve what you want.

In your case e.g. you could use Win-R and paste the url:

type("r", KEY_WIN)
wait(2) # wait for the dialog box to be ready
paste("www.yahoo.com") # the input field is selected already
type(Key.ENTER)

this should open the web page in your default browser

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