Highlighted
Absent Member.
Absent Member.
1009 views

Json query string issue

I have simple json

{
"type": "valid",
"price": "low",
"place": "newyork",
"post": "valid"
}

I want to set the name of 'place' from  newyork to california  

I have tried : 

lr_json_set_values("JsonObject=json_obj",
"Value=california",
"QueryString=$.place",
"SelectAll=Yes",
LAST);

Please help me in resolving it ???

Tags (1)
0 Likes
2 Replies
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: Json query string issue

Unfortunately this is a defect, update / set value doesn't work when depth of JsonPath is 1. ($.AAA doesn't work but $.AAA.BBB is ok). It will be fixed in next relase. But now you might have to modify raw string instead.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Json query string issue




Thanx for your update .I was new to loadrunner scripting .

Can you please provide a sample code for doing "modify raw string"

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.