clicking on an image within an image

Hi, I was wondering if it was possible to click on an image within another image.

For example, if I had a dialog that had multiple buttons that looked the same, but I wanted to click on the 2nd button from the top (let’s say it’s next to this other button). How would I do that? Would I capture the bigger image that encompasses both buttons, then try to click on the button within that image? I don’t want to specify coordinates since I don’t know if the dialog will stay in the same place the next time the test is run.

I would recommend a search rectangle for situations such as these. You can find detailed examples of the search rectangle here:

http://www.redstonesoftware.com/phpBB2/viewtopic.php?t=87

Another approach would be to use the EveryImageLocation() function and then click on the index of the button that you want:


put EveryImageLocation("r_button") into buttonLocations
click item 2 of buttonLocations

This approach relies on being certain of how many of the chosen item there will be on the screen. It also relies on knowing that Eggplant searches from the upper left of the screen to the bottom right, moving across and then down.