This article helps you understand various JSON processing and verification commands available in accelQ along with some examples. For various commands in accelQ, JSON node is specified in the standard JSON path format.
We will use the following sample JSON file content for the examples:
{
"store":{
"book":[
{
"category":"reference",
"author":"Nigel Rees",
"title":"Sayings of the Century",
"price":8.95
},
{
"category":null,
"author":"Evelyn Waugh",
"title":"Sword of Honour",
"price":12.99
}
],
"bicycle":{
"color":"red",
"price":19.95
}
}
}
Reading a JSON node
Get JSON Node value
Gets node value from JSON for the given JSON node path . The return value can be any json data type like JSON object, array, string, etc..
JSON path |
JSON node path to retrieve value |
Get JSON Array size
Gets JSON Array size from JSON content at given array node.
JSON content |
JSON content |
Validating JSON nodes
Verify JSON Node exists
Verifies node exists in given JSON content.
JSON path |
JSON node path |
Verifies node value in given JSON content matches expected value.
JSON content |
JSON content |
Is JSON Node value NULL
Enquires if node value is null from JSON content for the given node.
json content
|
JSON content
|
Verify JSON Array size Is
Verifies JSON Array size equals expected count from JSON content at given node.
json content
|
JSON content
|
Updating JSON Content
Set Value For JSON Property
Updates value for JSON property at given JSON path.
JSON content |
JSON content |
Add New JSON Property
json content
|
JSON content
|

Add Item to JSON Array
json content
|
JSON content
|
Log JSON Value
Prints a given JSON content in report, in a structured tree format.
parameter
|
JSON content to print
|
Comments
0 comments
Please sign in to leave a comment.