Exists on screen action Version 9 (Python)

Action group: Vision


Description

This action is intended to check (for a specified time) the existence of images similar to the sample on the screen.

Action icon

Action parameters

Input parameters

Sample image - The path to the sample image file. Supported image formats: (jpeg, jpg, bmp, png, tif, tiff). 

Similarity rate - The similarity coefficient between the sample and the searched area. The maximum value is "1". 

Timeout, ms - Time during which the specified object will be expected to appear. Timeout is set in milliseconds. Type - Robin.Numeric. 

Output parameters

Result - Returns "true" if the template image is found on the screen otherwise "false".

Settings

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
Sample imagePath to sample image file. Supported image formats: (jpeg, jpg, bmp, png, tif, tiff)Robin.ImageC:\doc\img.pngYes
Similarity rateCoefficient of similarity between the sample image and the target area. The maximum value is «1».Robin.Numeric
Yes
Timeout (ms)The time during which the appearance of the specified object will be expected. Time-out is set in millisecondsRobin.Numeric
No
Results
ResultReturns «true» if the sample image is found on the screen otherwise «false»Robin.Booleantrue

Special conditions of use

The search image resolution and the screen resolution must match for the action to work correctly.  For this purpose it is recommended to make a screenshot of the image.

If the result is "false" and the object is present on the screen, it means that it is necessary to specify the similarity rate with the search image.

The most effective way to use files with the extension ".png"

Example of use

Task

It is necessary to determine whether an image exists on the screen and display a dialog box with a message: image found on the screen or image not found on the screen. 

Solution

Use the actions "Exists on screen action", "If", "Show message". 

Implementation

  1. Assemble a robot scheme consisting of actions: 


  2. Set the parameters of the "Exists on screen action" action. 


  3. Set the "If" action parameter. 


  4. Customize "Show message" action parameters for true and false branches. 



  5. Click on the "Start" button in the top panel. 

Result

The program robot completed successfully. 

The image is found on the screen. The corresponding dialog box is displayed. 

  • Нет меток