Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.
Xpath - Extract element based on other element in the JSON response
I have a JSON response with following structure which is dynamic. I want to extract the account balance to a data bank of specific person eg:John
"Details" : [
{
"AccountBalance" : "6793",
"Person" : "John"
},
{
"AccountBalance" : "3646",
"Person" : "Peter"
0
Comments
-
Try an XPath like the following in your JSON Data Bank: /root/Details/item[Person/text() = 'John']/AccountBalance/text()
0 -
That worked. Thanks a lot!
0