Highlighted
Super Contributor.. Super Contributor..
Super Contributor..
3586 views

Save response value as parameter

Hi,

I am currently making use of web_rest in version 12.53 of Loadrunner.
sample POST method code:
{
   name : '/v1/media...',
   url : '/v1/media?context=TAG&contextValue=2&uploader=upload&source=AA',
   method : 'POST',
   enctype : 'multipart/form-data',
   snapshot : 't5.inf',
   itemData :
     [
        { name : 'medium', filename : 'C:\\Users\\Desktop\\method.txt' }
     ]
}

As response, I am getting id Value.
{
"id": "fd3d1-6c2f"
}

I want to save value of "id" in parameter.
Could anyone please help me?

Thanks

0 Likes
1 Reply
Highlighted
Respected Contributor.
Respected Contributor.

Re: Save response value as parameter

Hi,

You can save some value from response using such kind of code as below:

web.regSaveParamEx({
    paramName: 'praram2',
    lb: '',
    rb: '',
    scope: 'Body',
    ignoreRedirections: 'No'
    
});

    web.rest(
        {
            name : 'GET: http://52.39.153.71/', 
            url : 'http://52.39.153.71/', 
            method : 'GET', 
            snapshot : 't433392.inf'
        }
    );
lr.message(lr.evalString("{praram2}"));

 

For more details, ,you can visit the otehr thread in this community. https://community.microfocus.com/t5/Application-Perf-Mgmt-BAC-BSM/Loadrunner-saving-off-the-response-from-a-url/td-p/407667

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.