What's a global Daddy?

Well, I really try hard not to learn new things but I have a problem. Normally I run all my scripts from a Master Script against an SUT running XP. It’s time that I now ran them all on Vista but I want to be able to switch back to XP at will. The first problem is that about 4 images that I use will have to change in EACH script. For example the Start IE image looks different on Vista then on XP and changing to a classic theme won’t change it. So I need to make a new image for Vista but be able to switch all the scripts back to use the old one in a flash.

So what to do? I think the terminology is to declare the images as Global Variables that point to a set of Vista Vs. XP images??

But I’m not a programmer. Which is why Eggplant is so great! a hack like me can do amazing things using only 4% of his brain. But now I must learn a new trick.

Can someone point me in the right direction?

Thanks

Hello, Bass-O-Matic–

We test on 4 platforms, I think I may be able to help you.

First, We store all of our images in eggplant suites on their own-- ie Vista.suite XP.suite (the image suite naming is important, as you will soon see…)

Second, we have a master script as you do, but ours has a repeat loop:

put ("xpSUT.mydomain.com","vistaSUT.mydomain.com") into sut_list
repeat with each sut in sut_list
    connect sut
    //do stuff...
end repeat

Within this loop, we detect the operating system, and then load the correct suite of images:

set global currOS to detectOS
OpenSuite currOS&".suite"

Now, provided that your images are named identically, you can simply reference the image like you normally do:

click "myimage"

So all together, it looks like this:

global currOS
put ("xpSUT.mydomain.com","vistaSUT.mydomain.com") into sut_list
repeat with each sut in sut_list
    connect sut
    set currOS to detectOS
    OpenSuite currOS&".suite"
    click "myimage"
    disconnect
end repeat

All detectOS does is look for the start menu, and depending on which one it finds it sets the global currOS to VISTA or XP. That’s why the image suites are named the way that they are.

If you have more questions, let me know, and I’ll be happy to help

Allen

You can just use Image Collection.

Just put the Vista image and XP image in a same folder.

E.g. If you have Click “IE”,
You should have /IE/XP.tiff and /IE/Vista.tiff in your IE folder instead of having just IE.tiff.

Eggplant will automatically look for all the images in the folder and click the matching image.

Wow. Both great solutions… does Image Collection require eggplant purple? I have 2 greens.

I think green supports it as well.
Just make a folder for every images and put both vista image and xp image.
That way, you don’t have to change any of your existing code (unless vista version of whatever you are testing behaves differently than xp).