Wait For Images

The WaitForImages component enables you to change automation execution flow based on the image information on the screen. This component can be used for identifying the state of the business application or an item based on error or status icon.

Screenshot

Ports

The WaitForImages component exposes Control In, Control Out and Else ports by default.

Port Description
Control In Must be connected to the Control Out port of one or more components.
Dynamic Control Out Must be connected to the Control In port of any other component.
After you add more cases to the component, a control out port for every individual case is displayed.
Else Must be connected to the Control In port of any other component.
Would assist in defining exception if “No images are found”

Properties

To edit the properties of the WaitForImages component, in the Properties window, change the required property. You can edit the following properties:

Property Description
Search Search for the respective property.
Delay After Execution Specifies the wait time (in seconds) after the action is executed.
Delay Before Execution Specifies the wait time (in seconds) before the action is executed.
Max Wait Time (Seconds) Specifies the time (in seconds) the component will search for the image.
The default wait time is set to 30 seconds.
Name Specifies the name to identify the component. Set the name to match the application field you are interacting with.
Wait Options Specifies whether to wait for all applications or any one of the applications whose screen shots are taken in the component.

Example

Let us consider an example of finding a notepad or a calculator application.

Screenshot

To use the WaitForImages component:

  1. In the Toolbox, expand Wait.
  2. Drag the WaitForImages component and drop it on the Design surface.
  3. In the component title-bar, click Screenshot
  4. Click Screenshot,to capture the image of the application you want the component to find first.
  5. Press “CTRL+SHIFT” to select the region.

    The selected area is displayed in the WaitForImages component. In this example, an image of a notepad is captured.

    Note

    To re-capture the screen, right-click the screen shot and click Capture Image.

  6. Click Screenshot,to capture the image of the application you want the component to find second. The component finds this application only if it is unable to find the first application that you have selected.

  7. Press “CTRL+SHIFT” to select the region.
    The selected area is displayed in the WaitForImages component. In this example, an image of a calculator is captured.
    You can add as many screen shots of applications as you want. For this example, we have taken screen shots of the notepad and calculator applications.

    Add a Message Box component to display a success message for every application screen shot and a failure message if neither of the applications of found.

  8. To add the Message Box component:
    • In the Toolbox, expand General.
    • Expand MessageBox components, drag three Show component and drop it on the Design surface.
    • In two MessageBox components, enter a success message to be displayed when the respective image of the application is found.
    • In one MessageBox component, enter a failure message to be displayed when neither of the images are found.
  9. Connect:

    • The control ports of all components.
    • The Success Control Out ports of the WaitForImages component to the Control In port of the MessageBox component with the success message for the respective images.
    • The Else Control Out port of the WaitForImages component to the Control In port of the MessageBox component with the failure message.
  10. In the toolbar, click Run.
    The output with the success message if the notepad application is found, is displayed.

    Screenshot

  11. The output with the success message if the calculator application is found, is displayed.

    Screenshot

    Note

    Ensure to keep the application open whose images you have added to the WaitForImages component.To avoid the error of the WaitForImages component considering the image screen shot you have taken, as an application, minimize the Intellibot studio after you run the workflow.

  12. The output with the failure message is displayed.

    Screenshot