Skip to the content.

Expected errors

Setting the expected error flag to Y allows to define behaviour of the framework for negative testing.

If the flag is set to Y then an error in the execution is considered as a successful execution. The result interpretation of the action is reversed. Below are some examples where the expected error flag has been set to Y

Action type Command Output System result Framework result
cli.executeCommand ls /path/file.ext Cannot find file $?!= 0 Success
cli.executeCommand ls /path/file.ext File found (stats) $?== 0 Error
sql.evaluateResult select * from table where exp=1 No records found count = 0 error
sql.evaluateResult select * from table where exp=1 100 records found count = 0 success