Property transfer using JSON nodes count
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Property transfer using JSON nodes count
How to perform property transfer to keep track on no of nodes returned in JSON response:
eg:
{
"firstName": "John",
"lastName" : "doe",
"age" : 26,
"address" :
{
"streetAddress": "naist street",
"city" : "Nara",
"postalCode" : "630-0192"
},
"phoneNumbers":
[
{
"type" : "iPhone",
"number": "0123-4567-8888"
},
{
"type" : "home",
"number": "0123-4567-8910"
}
]
}
here for phoneNumbers we have 2 nodes.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ReshmaSachdev,
I suggest that you review the following article: http://readyapi.smartbear.com/structure/steps/property/transfer/example
It contains a great example of how to transfer property values in your project.
Does it help?
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have been using property transfer step using xpath to 'count' no of nodes, but with JSONPath there is no reference given.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for delay response.
select property transfer as "ResponseAsXml" then Path Language as "XPath"
${#ResponseAsXml#count(//*:number)}
Hope this will Help?
Ashoob.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for sharing, @pak2redy!
Olga Terentieva
SmartBear Assistant Community Manager
