This topic covers the JSON Assertor tool, which lets you place assertions on different elements in a JSON message. This tool requires a validate license.
Sections include:
Table of Contents | ||
---|---|---|
|
...
Note | |||
---|---|---|---|
| |||
The JSON Assertor tool was re-implemented in version 9.7. The previous implementations are deprecated: any existing tools will continue to work, but all new JSON Assertors you add will use the new implementation. This topic focuses on the current JSON Assertor implementation. Conditional Content | | Product: (SOAVirt, SOAtest) | Product: (SOAVirt, SOAtest) |
sv-attr:0A010204015A9054C88481D043445E2F | 0A010204015CF6008A11EEF43AC91334 0A010204015A9054C886C0AC137B8C01 |
Understanding JSON Assertor
JSON Assertor is used to enforce the correctness of data in a JSON message. It enables you to introspect into individual elements in JSON messages and check whether they meet expectations.
...
JSON Assertor can be chained against any tool that communicates a JSON message, It is most commonly connected with the Messaging Client and REST Client tools.
This tool is often added from the Create/Update Regression Control dialog for JSON messages (by choosing the Create Value Assertion option). For details on adding JSON Assertors in this manner, see Validating the Value of an Individual Response Element.
It can also be added via the Add Output wizard, which is described in Adding Test Outputs.
Configuring JSON Assertor
...
The Trim content option will remove any white space from the start and end of the extracted string before comparing it to the expected text. For example, if " bar " was extracted (ignore quotes in all examples; they are used to show white spaces), it would become "bar"; this would match "bar" (and fail to match " bar ") if the Trim content option was not enabled.
...
...
Video Tutoral
In this video, you'll learn how to add targeted assertions for values in JSON responses.
Widget Connector | |
---|---|
|
...
|
...
|
...
|
...
|
...
|