...
This topic provides information on selecting JSON elements in the JSON Assertor and JSON Data Bank tools in
...
Virtualize
...
Virtualize
.
Sections include:
Table of Contents | ||
---|---|---|
|
...
For working with JSON and selecting nodes,
...
Virtualize
construct Virtualize construct an XML DOM "under the hood" in order to use XPath for node selection. The XML structure very closely matches the JSON structure. All names and values are equivalent, except for the following cases:
The root node of the document is called
root
in the XPath, but is an object or array reference in the JSON document. It appears as{}
or[]
inConditional Content Product: (Virtualize) Product: (Virtualize) sv-attr:0A010204015A9054C88481D043445E2F 0A010204015A9054C88802B9600247DF Virtualize
JSON inVirtualize JSON trees.
Array items are called
item
in the XPath, but are unnamed in the JSON document (by nature of being array elements). They appear as[0]
,[1]
, etc. inConditional Content Product: (Virtualize) Product: (Virtualize) sv-attr:0A010204015A9054C88481D043445E2F 0A010204015A9054C88802B9600247DF Virtualize
JSON inVirtualize JSON trees.
JSON names that contain characters that are illegal in XML element names are transformed to create legal XML element names for use in XPaths.
Conditional Content Product: (Virtualize) Product: (Virtualize) sv-attr:0A010204015A9054C88481D043445E2F 0A010204015A9054C88802B9600247DF Virtualize
JSON Virtualize JSON trees will show the original names as they appear in the JSON document.
When you select a JSON tree node,
...
Virtualize
also Virtualize also create a corresponding XPath.
...
- Custom column name: Specifies the name of the data source column in which to store the value. Values are stored in an internal data source unless you specify otherwise (e.g., if you select Writable data source column or Variable). This is the name you will use to reference the value in other places. For example, if it is stored in a data source column named My Value, you would choose My Value as the parameterized value. You could also reference it as
${My Value}
in literal or multiple response views. Writable data source column: Tells
Conditional Content Product: (Virtualize) Product: (Virtualize) sv-attr:0A010204015A9054C88481D043445E2F 0A010204015A9054C88802B9600247DF Virtualize
to TellsVirtualize to store the value in a writable data source column. This allows you to store an array of values. Other tools can then iterate over the stored values.
- Write to all columns that match: Enables you to store values in all columns with names that contain the specified string. When extracting multiple values from a message, each value will be written across all the columns that match. In contrast, if you pick a single writable data source column (the above option), then the values will be written down the column across multiple rows.
Variable: Enables you to save the value in the specified variable so it can be reused across the current test, Responder, or Action suite. The variable must already be added to the current suite as described in
Conditional Content Product: (Virtualize) Product: (Virtualize) sv-attr:0A010204015A9054C88481D043445E2F 0A010204015A9054C88802B9600247DF Defining Variables in Virtualize
. Any values set in this manner will override any local variable values specified in the suite properties panel.
...
For headers, you can configure the header name, as well as the data source column options listed above.
Parameterizing XPaths
You can parameterize XPaths to reference test or Responder suite variables, environment variables, and data source values. The syntax to reference variables is ${myVariableName}
. The syntax to reference Data Bank values and Data Source Values is: ${myColumnName}
.
...