Why pulsing mode vs. precise mode?

I found recently when creating a test script that an image I saved as precise recognition mode was not recognized by my script, but when I saved the same image as pulsing recognition mode, it was recognized immediately. Why is this the case? What are the differences between the different image recognition modes?

Hi, Derrick:

My guess is that if you set the image to use the Tolerant search type that it also would have been found. The Precise and Tolerant search types allow varying degrees of color variation in the image matching.

Each pixel in the saved TIFF files has a color defined as different values of red, green, and blue between 0 and 255. By default, the Precise search type allows each of these values on the screen to differ from the saved image by only one value or intensity. So if one pixel of your saved image has a saved color of medium gray (127, 127, 127 ), then using the default Precise settings, the onscreen pixel will match if its color intensity is between 126 and 128 in all three channels. If any of the three channels for the onscreen pixel varies by more than one intensity value (plus or minus) then the image won’t be found. This search type is automatically selected if your image has a very low contrast between its lightest and darkest pixels, such as an inactive (grayed-out) menu item.

The Tolerant search type allows each channel of each pixel to vary by as many as 45 intensity values in either direction, so using the example above, any color between 82, 82, 82 and 172, 172, 172 will be a match. The Tolerant search type is most often automatically selected by Eggplant because it is the most forgiving search type.

The Pulsing search type is meant to deal with the “pulsing” buttons in Mac OS X. This uses a combination of the Tolerant search type and an alpha mask that removes the lighter pixels from the image. This allows Eggplant to find the pulsing buttons, even though their color changes from light to dark and back again over several seconds.

There are two additional search types, the Text search type and the Text & Pulsing search type. The Text search type is used primarily when running against another Mac OS X machine. The Quartz rendering engine of Mac OS X uses dynamic antialiasing of text. This means that the same text displayed on the same GUI element may be rendered differently from one run to the next – not just in terms of color, but in the positioning of the pixels. The Text search algorithm compensates for these differences. Text & Pulsing compensates for these differences when they appear on pulsing buttons. Neither of the Text search types is ever selected by Eggplant automatically; you must manually choose them.

Often Precise, Tolerant, and Pulsing are all you will ever need; if you find that images containing text are not being found, then you should try using the Text search types. You may opt to manually select the Text type to begin with when capturing images containing text, rather than waiting to see if searches fail later on.

The default degrees of tolerance for the Precise and Tolerant search types are configurable under Eggplant > Preferences… > Run Options > Screen and the tolerances can also be set via code within the script; on an image-by-image basis in the Info drawer of the Images tab; and through one-time, property-list overrides in image-based commands.

I hope this helps to clarify how the various search types work and give you some idea of when you might want to override Eggplant’s automatic selections.

Does the text algorithm work well with Windows?

I had a team member who saved all the images saved from Windows in the text mode. Would I be better off changing these to tolerant images?

There shouldn’t be any reason to use the Text search type with Windows SUTs. Their anti-aliasing routines aren’t as dynamic as those used by Mac OS X, so in our experience the characters are always displayed using the same pixels. The Text search type will be slower and there is a greater possibility of false matches than with the Tolerant search type. So yes, for Windows testing I would recommend the Tolerant search type over the Text search type.