I would like to use Sikuli to automate both GUI apps and Web apps running within browser on Mac OS X and Windows. My purpose is currently less for testing, and more for GUI auto
Maybe this will give you some idea's.
I have a file where I have multiple definition that need to look for a certain image.
Somethimes the image they need to look for is different in different browsers.
So I use something like this:
File: ImageLib.sikuli
browser_Windows_Firefox = ("windowsFox.png")
browser_Mac_Firefox = ("macFox.png")
File: Execute.sikuli
from ImageLib import *
# Variable you can get set somewhere
operatingSystem = 'Mac'
image = ()
if (operatingSystem == 'Windows'):
image = browser_Windows_Firefox
elif (operatingSystem == 'Mac'):
image = browser_Mac_Firefox
else:
# Unknow option here....
pass
# Find and highlight it.
imageLoc = find(image)
imageLoc.highlight(5)