Verify Functions

Verify functions check the same conditions as the assert functions, but they do not abort the script at the step. A failed verification is recorded, and what happens next is decided by the assert type set for the run.

setAssertType(value)

Sets the behaviour applied when an assert or verify fails. It applies to the rest of the script.

ValueBehaviour on failure
Fail (default)The script stops at the step that failed.
FailAtEndThe script keeps running and the execution is marked as failed once the whole script completes.
WarningOnly a warning is logged, the script continues, and the failure is not raised as an error.
setAssertType("Warning");   // collect all verification warnings and keep the script running
setAssertType("FailAtEnd"); // keep running, but fail the run at the end
setAssertType("Fail");      // default: stop at the failed step

Verify APIs

The verify set mirrors the assert set: every assert API has a verify equivalent with the same parameters, and it can be used anywhere a statement is accepted — including inside a branch or a loop, where an assert would stop the playback.

Assert APIVerify equivalentChecks that
assertTrue / assertFalseverifyTrue / verifyFalsea boolean is true / false
assertExists / assertNotExistsverifyExists / verifyNotExiststhe element exists / does not exist
assertEquals / assertNotEqualsverifyEquals / verifyNotEqualstwo values are equal / different
assertNull / assertNotNullverifyNull / verifyNotNulla value is null / not null
assertContainsTextverifyContainsTextan element contains the text or regular expression
assertDoesNotContainTextverifyDoesNotContainTextan element does not contain the text or regular expression
assertGreaterThan / assertLessThanverifyGreaterThan / verifyLessThana number is greater / lesser than another
assertRangeverifyRangea number falls between a minimum and a maximum

The reference also lists a Validate call alongside the verify APIs.

Example

navigateTo("http://demosite.appvance.com/");
wait(1000);

setAssertType("Warning");

verifyExists(span("Products[1]"));
verifyContainsText(span("Products[1]"), "Ruby");
verifyTrue(isVisible(link("Clothing")));

// the script continues even when one of the checks above fails,
// and the failures are reported with the run

Choosing between assert and verify

Related: Assert Functions, Assertions (function signatures).


Revision #3
Created 2026-07-24 14:33:12 UTC by Admin
Updated 2026-11-20 17:09:58 UTC by AI_Mananger