Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SOAVIRT_9.10.4_CTP_3.1.1

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
maxLevel1

...

For details on the deprecated JSON Assertor, see JSON Assertor Deprecated.

Note
titleMigration 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:0A010204015A9054C88481D043445E2F0A010204015CF6008A11EEF43AC91334 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.


Image Modified


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
width

...

600

...

urlhttps://

...

www.

...

youtube.com/

...

watch?v=kjqCbtOO6SE
height400