How to use Find Image Matches Activity

How to complete the below actions using "Find Image Matches" activity?

Find Image Activity helps us to select the required image and returns an IEnumerable collection of "UiElements" which can be used to solve the scenarios mentioned above

  • Click on the first or the last Image

          

 Here, we need to click on the first checkbox ("Bike"). Reference Image for the activity is the "checkbox" icon

Steps

      1. Drag "Find Image" activity (preferably after "Open Browser" or "Attach Window" activity)

      2. Specify the image you want to click using the "Indicate on Screen" option

      3. The output of the activity will be an IEnum of UiElements (say test_img)

      4. Drag "Click" activity and specify in the Element attribute the following - test_img. First (it will click on the first image) /test_img. Last (it will click on the last image)
 

  • Click on the images iteratively

       

Here, we need to click on the checkboxes iteratively. Reference image for the activity is the "checkbox" icon

Steps

      1. Drag "Find Image" activity (preferably after "Open Browser" or "Attach Window" or "Open Application" activity)

      2. Specify the image you want to click using the "Indicate on Screen" option

      3. The output of the activity will be an IEnum of UiElements (say test_img)

      4. Drag "For Each" activity inside the Project (Set the Object Type to UiElement)

      5. Drag "Click" activity and specify in the Element attribute specify the index used in the "For Each" which will get the images one by one and click accordingly. 
 

  • Get the count of the images available on the screen 

            

Here, we need to get the count of the no of Units having the "Start" option selected. The reference image for the activity is the image having the "Start" option selected

Steps

     1. Open the PDF file using Open Application/Start Process activity

     2. Scroll down to the place where the images are located using Send Hotkey Activity.

     3. Drag "Find Image" activity

     4. Specify the image you want to click using the "Indicate on Screen" option

     5. The output of the activity will be an IEnum of UiElements (say test_img)

     6. Display the count inside "Write-Line"  or "Message Box" activity using test_img.Count.toString