Highlighted
Contributor.
Contributor.
272 views

Vugen/TruClient Header Information

Is it possible in the course of running a script in TruClient to get a specific header value? Specifically we are trying to get a token value that is being passed via header.

0 Likes
1 Reply
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: Vugen/TruClient Header Information

Hi Rick, 

you can catch a particular value from response's headers using web_reg_save_param() or web_reg_save_param_regexp(). The difference between two functions are about the capture method: the first one expects left and right boundaries and save into a parameter the test in the midst of them; the second function capture a string by means of the regular expression. 

You can point that the string you want to capture stands on headers using "Scope" function's argument, for instance

    web_reg_save_param_regexp( "ParamName=aaaa", "RegExp=xx(.*?)yy", SEARCH_FILTERS, "Scope=Headers", "IgnoreRedirections=No", "RequestUrl=regularExpr", LAST);

Lorenzo

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.