verifyWebImages

This is a pre-built Action located under the @Custom Element. The functionality of this Action in Avo Assure is to compare the image on the web page specified in the input against the provided image path. The result is stored in the given dynamic variable for further use during test execution.

circle-info

The verifyWebImages action works only when the VerifyExists action is executed in a preceding step.

Syntax

Input Value: <ObjectType>;<VisibleText(optional)>;<Index>;<image path>;<abs(optional)>

Argument
Description

<ObjectType> (Required)

Provide the object type which you want to perform the verify web image operation. (e.g., Image)

<VisibleText> (Optional)

Provide the visible text associated with the object.

<Index> (Required)

Provide the position of the object you want to identify based on its sequence in the application. Note: Index start from 0.

<image path> (Required)

Provide the path of the image which you want to compare with the captured image.

<abs> (Optional)

Provide the absolute XPath of the object you want to identify for this operation.

circle-info

Note:

  • If the last argument abs is defined, the action executes using absolute identification based on the specified absolute XPath provided in the input.

  • To skip an optional input value, use an extra semicolon (;).

Output Value: <Dynamic Variable>(Optional);<Dynamic Variable>(Optional)

Argument
Description

<Dynamic Variable>(Optional);<Dynamic Variable>(Optional)

Both dynamic variable stores the status as True or False.

Example 1: Verifying the Image Displayed in a Web Object

In this example, we are explaining how to validate whether the image displayed in a specified object matches the expected reference image on the web page.

  • Action: verifyWebImages

  • Input Value: ImageObject;;0;C:\TestImages\Logo.png

    • The first argument (ImageObject) specifies the object type to be identified.

    • The second argument is left blank to skip an optional value.

    • The third argument (0) specifies the index of the object when multiple matching elements are present.

    • The fourth argument (C:\TestImages\Logo.png) specifies the expected reference image path that needs to be verified.

  • Output Value: {Status}

    • The result of the image verification operation is stored in the {Status} dynamic variable.

      • True: If the displayed image is verified against the expected reference image.

      • False: If the displayed image is not verified against the expected reference image.

  • Logical Explanation: The verifyWebImages action reads the identification details and expected reference image path from the Input Value column (ImageObject;;0;C:\TestImages\Logo.png). The action locates the matching object based on the specified object type and index and compares the image rendered on the web page with the provided reference image. The execution result of the verification operation (True) is stored in the {Status} variable.

Example 2: Verifying the Image Displayed in a Web Object using Optional Parameters

In this example, we are explaining how to validate whether the image displayed in a specified object matches the expected reference image on the web page using optional identification parameters.

  • Action: verifyWebImages

  • Input Value: ImageObject;Logo;0;C:\TestImages\Logo.png

    • The first argument (ImageObject) specifies the object type to be identified.

    • The second argument (Logo) specifies an optional identification value for the object.

    • The third argument (0) specifies the index of the object when multiple matching elements are present.

    • The fourth argument (C:\TestImages\Logo.png) specifies the expected reference image path that needs to be verified.

  • Output Value: {Status}

    • The result of the image verification operation is stored in the {Status} dynamic variable.

      • True: If the displayed image is verified against the expected reference image.

      • False: If the displayed image is not verified against the expected reference image.

  • Logical Explanation: The verifyWebImages action reads the identification details and expected reference image path from the Input Value column (ImageObject;Logo;0;C:\TestImages\Logo.png). The action locates the matching object based on the specified object type, optional identification value, and index and compares the image rendered on the web page with the provided reference image. The execution result of the verification operation (True) is stored in the {Status} variable.

Last updated