The commands IMAGESEARCH and IMAGECLICK are active after the Image Recognition Plugin installation.
Search for an image on a website
The command to search ceratin images on a website is called IMAGESEARCH and has two parameters, IMAGE and CONFIDENCE. The command works by searching for the appearance of an image on the web site, which is saved locally on your hard drive. The parameter IMAGE sets the image that the Plugin searches for. The parameter CONFIDENCE tells the Plugin how close the image must match the image on the website. A confidence level of 100 means that the input image and the image on the website must be 100% identical - an exact match; otherwise the IMAGESEARCH command generates an ERROR. A confidence level of less than 100, e.g. 95, allows for some deviation in the color of the image, or a change in the image background or foreground colors.
Click (or send text) to a certain area of the website (defined by an image)
The command to click or send content to an image on a web site is called IMAGECLICK. This command has three parameters, IMAGE, CONFIDENCE and CONTENT. The command works by searching for the appearance of an image on the web site, which is saved locally on your hard drive. If this image, supplied by the IMAGE parameter, is found, the CONTENT is send to it. The parameter CONFIDENCE has the same function as in the IMAGESEARCH command.
The internal variables !IMAGEX and !IMAGEY are the X/Y coordinates of the middle of the position where the "pic1.bmp" image was found. They are set by the IMAGESEARCH command.
Some comments on the CONFIDENCE parameter:
A confidence level of 100 means that the input image must match the image found on the web page 100%. The images are identical on the pixel level. This also means that no deviations in size, color or shape are allowed. The search algorithm used for CONFIDENCE=100 is very fast. It is recommended that use 100 if you do not expect any changes in the image. Typical search times are less than a second on a PC with a 2.5 GHz CPU.
A confidence level of less than 100 means that the input image does not have to match the image found on the web page exactly. Deviations in color or shape are allowed. The lower the confidence level, the more deviations are allowed. If you simply want to ignore color changes, a CONFIDENCE level of 95 is recommended. If you lower the confidence level too much, iMacros will detect the wrong image as an acceptable match. For typical web testing applications, levels between 50 and 99 have proven to be useful. Since, the search algorithm uses advanced image recognition technology it is not as fast as a CONFIDENCE=100 search. Also, the search time increases with input image size. Typical search times are between 1-3 seconds on a PC with a 2.5 GHz CPU.