web.imageCheck

Verifies the presence of a specified image inside an HTML page.

Syntax

web.imageCheck(  {object} );

JavaScript Object

{
    stepName: "<string>",
    frame: "<string>",
    expect: "<string>",
    matchCase: "<string>",
    repeat: "<string>",
    report: "<string>",
    onFailure: "<string>",
    alt: "<string>",
    src: "<string>"
}
Property Name
Description
stepName
The name of the image check, as it appears in the test tree.
frame The name of the frame in which you recorded the operation. The name of the frame is the value of the name attribute of the FRAME element.
expect

One of:

  • "found" - Indicates that the check is successful if the script finds the specified search criteria. (Default)
  • "notfound" - Indicates that the check is successful if the script does not find the specified search criteria.
matchCase

Case-sensitive match for alt tag. One of:

  • "yes" - case-sensitive
  • "no" - ignore case
report

Sets what to output to the log. One of:

  • "success" - Displays check results only if the check succeeds.
  • "failure" - Displays check results only if the check fails.
  • "always" - Always displays check results. (Default)
onFailure

Set whether the script instance aborts if the check fails. If not passed, then the state of Continue on Error is used.

  • "abort" - The script instance aborts if the check fails, regardless of the error–handling method set in the run–time settings.
alt
The alt tag of the image.
src
The src tag of the image.

Return Values

Not applicable

Parameterization

You can use standard LoadRunner parameterization with all string values in JavaScript objects.

General Information

The web.imageCheck function verifies the presence of a specified image inside an HTML page.

Either alt or src, or both, must be in the argument list. If both are passed, the check passes if both match a single image element.

Example

web.imageCheck({stepName:"Go2Venus", alt:"Venus"} );