Warning

3.3.8 Warning

DESCRIPTION

Warning - Insert a warning into the report. A warning can be associated with a specific screenshot through the image parameter. Such a warning will be displayed below the image description in the report. If there's no associated image, the warning will be displayed in the report as a single component.

When a script is being executed and there's a running report provider (i.e. the script contains a Report command), an execution of a Warning command will trigger a refresh of the report. If there's no active report provider, a warning is created in the internal tables but it is not reported in any way.

SYNOPSIS

warning <description> [image=<screenshot_name>]
* Red colour indicates obligatory parameters

OPTIONS

description

- Text of the warning to be displayed in the report.

image=<screenshot_name>

- A screenshot to be associated with the warning. The screenshot name should correspond to an image created by the Screenshot command.

RETURNS

The Warning command always returns 0 (zero).

EXAMPLES

Report index.html 
Exec "mozilla file://{_REPORT_FILE}" 
if ({_EXIT_CODE} > 0) {
  Warning "Mozilla failed to start. Error output: {_EXEC_ERROR}" 
}

- Try to open the HTML report in a Mozilla browser using the Exec command and add a warning if it fails. 

Screenshot image.jpg template=template1.png onfail="Warning \"The image image.jpg doesn't seem to display what is expected.\" image=image.jpg"

- Take a screenshot and compare it to a template called template1.png. If the comparison fails, add a warning to the image description.