There are a few nice things about the “CONTAINS” Assertion.
- You can put any word or phrase you expect in return
- You can check the box to ignore case comparison
- You can use a token expression (major plus so you don’t have to use Script Assertions)
For the record I’m only going to list some Token Expressions. 1 & 2 are simple type and save.
Here is an “OR” statement that after I process an order, I’m runing a JDBC test step to verify the order was either “Processed” or “Pending”. Therefore if the response returns otherwise like “Failed” or “Cancelled” this assertion will fail.