Taking a screenshot of an image on one screen and comparing/finding it on another page

Asked by John Davis on 2017-06-02

I'm building a script using Sikuli and ran into a bit of a wall. I'm basically trying to capture a screenshot of an image on a screen and compare/find it on another screen. I've used capture() to no avail.

Help would be much appreciated.
Here is my simple code. It always prints yes for some reason.

x=capture(Region(268,856,312,20))
click("next tab")
if exists(x):
    print "yes"
else:
    print "no"

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2017-06-02
Last reply:
2017-06-02
masuo (masuo-ohara) said : #1

It is possible that the application is not write next tab image when SikuliX run exists() feature.
Try to add sleep() before exists().

click("next tab")
sleep(1)
if exists(x):

Can you help with this problem?

Provide an answer of your own, or ask John Davis for more information if necessary.

To post a message you must log in.