Assert Greater

This assertion is used to check if the element value described by the expression is greater than a proposed value. The values can be compared as a string or number. Parameters:
Name Type/Value Required
Expression Expression Yes
Value String Yes
Type ‘integer’ or ‘float’ No
Mode ‘all’ or ‘one’ No
Level ‘error’ or ‘warning’ No
Modifier ‘not’ No
Execute if item exists ‘true’ or ‘false’ No
Stop test if fails ‘true’ or ‘false’ No
Comment String No
  Expression: It’s the path to the element we want to operate on (ex: payload.ProductID). See Expression for more details. Value: The value we want to compare the expression to. Type: The data type of the value. This attribute is optional. If no type is defined the values will be compared as strings. If the type is set the values will evaluated with the chosen comparator (ex: ‘integer’ as a whole number, ‘float’ as a decimal number). Mode: Specify if all the same elements in the payload should match the assertion (‘all’) or if only one element (‘one’) is enough. Level: Specify if the assertion fails whether it should be considered an ‘error’ or just a ‘warning.’ A warning will not trigger alerts (such as email or text messages). Modifier: The assertion is considered verified if it does not pass. Execute if item exists: The assertion is evaluated only if the element exists. This is useful when the element does not always exist. Stop test if fails: The test will be immediately stopped if the assertion fails.   Code View Examples:
<assert-greater expression=”data.code” value=”4503″/>
<assert-greater expression=”data.code” value=”4503″ type=”integer”/>

Assert Contains

This assertion is used to check if the element described by the expression contains a specific substring. For example, to test the word Uber is in Uber’s product names (UberX, UberBlack, UberPool). Parameters:
Name Type/Value Required
Expression Expression Yes
Value String Yes
Mode ‘all’ or ‘one’ No
Level ‘error’ or ‘warning’ No
Modifier ‘not’ No
Execute if item exists ‘true’ or ‘false’ No
Stop test if fails ‘true’ or ‘false’ No
Comment String No
  Expression: It’s the path to the element we want to operate on (ex: payload.ProductID). See Expression for more details. Value: The value we want to compare the expression to. Mode: Specify if all the same elements in the payload should match the assertion (‘all’) or if only one element (‘one’) is enough. Level: Specify if the assertion fails whether it should be considered an ‘error’ or just a ‘warning.’ A warning will not trigger alerts (such as email or text messages). Modifier: The assertion is considered verified if it does not pass. Execute if item exists: The assertion is evaluated only if the element exists. This is useful when the element does not always exist. Stop test if fails: The test will be immediately stopped if the assertion fails.   Code View Examples:
<assert-contains expression=”data.url” value=”domain.com”/>
<assert-contains expression=”data.id” value=”${id}”/>

Assert Exists

This assertion is used to check if the element described by the expression exists. The presence of the element, even empty, is enough to consider it a valid assertion. Parameters:
Name Type/Value Required
Expression Expression Yes
Mode ‘all’ or ‘one’ No
Level ‘error’ or ‘warning’ No
Modifier ‘not’ No
Stop test if fails ‘true’ or ‘false’ No
Comment String No
  Expression: It’s the path to the element we want to operate on (ex: payload.ProductID). See Expression for more details. Mode: Specify if all the same elements in the payload should match the assertion (‘all’) or if only one element (‘one’) is enough. Level: Specify if the assertion fails whether it should be considered an ‘error’ or just a ‘warning.’ A warning will not trigger alerts (such as email or text messages). Modifier: The assertion is considered verified if it does not pass. Stop test if fails: The test will be immediately stopped if the assertion fails.   Code View Example:
<assert-exists expression=”data.id”/>

Assert Is

This assertion is used to check if the value of the element defined by the expression belongs to a specific type. This is one of the more commonly used assertions because it can be used to verify various things such as whole numbers, email addresses, phone numbers, URLs, and so forth. Parameters:
Name Type/Value Required
Expression Expression Yes
Type ‘integer’, ‘float’, ‘url’, ‘boolean’, ‘phone’, ’email’, ‘map’, ‘array’ Yes
Mode ‘all’ or ‘one’ No
Level ‘error’ or ‘warning’ No
Modifier ‘not’ No
Execute if item exists ‘true’ or ‘false’ No
Stop test if fails ‘true’ or ‘false’ No
Comment String No
  Expression: It’s the path to the element we want to operate on (ex: payload.ProductID). See Expression for more details. Type: The data type of the value. The possible values are: ‘integer’, checks if field is an integer value; ‘float’, checks if field is a decimal value; ‘url’, checks if the field is a well formatted url; ‘boolean’, checks if field is a boolean value; ‘phone’, checks if field contains a valid phone number format; ’email’, checks if field is a valid email format; ‘map’, checks if field is a map type; ‘array’, checks if the field is an array Mode: Specify if all the same elements in the payload should match the assertion (‘all’) or if only one element (‘one’) is enough. Level: Specify if the assertion fails whether it should be considered an ‘error’ or just a ‘warning.’ A warning will not trigger alerts (such as email or text messages). Modifier: The assertion is considered verified if it does not pass. Execute if item exists: The assertion is evaluated only if the element exists. This is useful when the element does not always exist. Stop test if fails: The test will be immediately stopped if the assertion fails.   Code View Example:
<assert-is expression=”data.id” type=”integer”/>