0

Which tag is used to compare images using computer vision in PAF? For example, I want to check whether an image is present in the full screen of web application while automation. The tag should be able to return the precision.

1 Answers1

0

CV tag can be used to compare images using computer vision API. This is supposed to help us automate static UI testing. The way it would work is as follows.

  1. Screenshot of the screen area to be validated would be captured while writing scripts.
  2. Screenshot of the full screen will be taken at runtime.
  3. The screen area captured at the time of script creation would be compared against the screenshot taken at runtime.
  4. The output would be a screenshot where the matched image would be marked in the screenshot, x and y coordinates (in variables) and the matching precision (in variable).
  5. Generally, when the image matches, the precision is above 0.995 or something. When the script is being built, we need to check the precision number and validate the same with validation tag.

Syntax:

<cv screenshotFile="" fileToMatch="" outputFile="" resultVarName="" locXVarName="" locYVarName="" desktop=""></cv>
  1. screenshotFile - contains the location where the screenshot will be saved at runtime.

  2. fileToMatch - contains the path of the screen area image that needs to be checked in the screenshot

  3. outputFile - path where the output file containing the image matching result needs to be saved

  4. resultVarName - name of the variable which will contain the
    matching precision output

  5. locXVarName - Name of the variable which will contain the x coordinate where the image has matched in the screenshot

  6. locYVarName - Name of the variable which will contain the y coordinate where the image has matched in the screenshot

  7. desktop - whether the screenshot is a robot screenshot or not. If this is
    false, it will use selenium to take the screenshot in the browser. If true, it will use robot screenshot.

Anjana
  • 1
  • 1