An assert statement contains a boolean expression where this condition must hold true for the test execution to continue. Thus, execution of the assertion causes evaluation of the boolean expression, and an error is reported if the expression evaluates as false.
Once a test step is added as any of the control statements, it is not allowed to change into another keyword.
In manual view
- Open a test case in Manual view. Click on the drop-down icon of the Add button, then choose Assert Statements.
- To add a keyword under a statement, select that statement, then click Add . A test step is created under that statement.A test step represents assert expression is added to the test case.
- Double-click on the Input cell to edit the called method.
In script view
The Script view of test cases allows you to programmatically define and handle assertions using either Groovy or Java language. For more details regarding assertions in Groovy, refer to this Groovy documentation: Core Testing Guide.html.
assert varA == true