ggc.notifyFailure
Report a scenario failure.
Syntax
notifyFailure( message STRING )
- message is the failure message to register.
Usage
You can use this method to notify the scenario user when a check fails. If you expect a failure
to be recorded and reported at the end of the scenario, call this function at the point where your
check fails. The failure will be logged with file and line number information. At the end of the
scenario, all recorded failures will be listed in the following
format:
filename:lineno:error:messageFor
example:/home/f4gl/app/myapp.4gl:82:error:(GGC-2) The action 'hello' is not found.Failed
checks generate error numbers. GGC error numbers (for example GGC-2), are displayed in a way that
makes them clickable in Genero Studio so the file and line where the error occurred can be found.
For this reason, you need to provide error numbers for the check failures you report. Calling this
function stops the scenario.For example:
DEFINE msg ggc.Message
CALL ggc.getMessage() RETURNING msg.*
DISPLAY msg.message
IF msg.message != "User successfully created." THEN
CALL notifyFailure("(GGC-2) Expected 'User successfully created.', got: '" || msg.message || "'")
END IF