← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #166709]: I have made a Sikuli program for Google Chrome (Windows), will it work on Google Chome (MAC)?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--- will it work on Google Chome (MAC)?

principally yes.

restrictions:
-- things like switchApp(), ... and the App class work different on Win (window title oriented) and Mac (app oriented)
-- keyboard shortcuts used with type() are different (e.g. crtl-L vs cmd-L to jump to url entry)
-- app specific differences in the GUI

So if you want to make your script aware of the environment it is running on, you can use 
http://sikuli.org/docx/globals.html#Env.getOSVersion

together with functions, that handle the differences.

a quick and dirty example:

def kbCtrl(key):
    if Env.getOS() = OS.MAC:
        type(key, KEY_CMD)
    else:
        type(key, KEY_CTRL)

--- images
You have to take care, that the images in the browser window on the different systems are rendered the same way pixel by pixel. If this is not the case, you have to manage two sets of images and switch the sets accordingly.

--- test it
If you do not have a Mac or someone who has one, where you can do it: no chance.

I you have a DVD of MAC  OSX 10.6 SnowLeopard, you can run this in a
VMBox on Windows7. But the environment is restricted and might make more
problems, than it is worth.

Another possibility: Find someone who has the appropriate environment and ask him to let you play on his system using some remote access (TeamViewer, Skype, ...).
I just think, that this is a good idea: making one of my Macs accessible over the net for such purposes. Since I already switched to Lion, which has much more capabilities here, I will test it the next days. For now though, this does not help you, sorry.

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