PHP: Make test fail

In order to make a test fail due to changes in data, click Editor->Control->EVAL to insert a PHP code evaluation.

See How to evaluate a PHP commands to manipulate variables and clipboard (Experimental feature) for details on EVAL action.

EVAL error("Text 'Step 1' not found.")

Makes the test fail with “Text ‘Step 1’ not found.” as error message:

Befor playing EVAL step.
After playing EVAL error(“Text ‘Step 1’ not found.”)

Example 1: Clipboard value

If you would like to assert that the clipboard contains value “Testing” use

EVAL $CLIPBOARD=="Testing"||error("Wrong value")

Example 2: Maximum loop passes

If you want to make sure that a loop does not run endlessly, you can limit the number of loop passes and make test fail after reaching the maximum number.


…some actions…

EVAL set("counter", get("counter") + 1) < 10 || error("Too many loops")