0

In response, an authentication value consists of \ to escape / in parameter so while capturing parameter it is getting "\" in middle as well but in subsequent request need to send with out "\" is there any way to do this in LoadRunner

Example :-

web_reg_save_param_ex(
    "ParamName=pValue",
    "LB=Value:",
    "RB=\"",
    SEARCH_FILTERS,
    "Scope=Body",
    LAST);

Captured Value is AdfjshxnjkAKLDKLJlk\/ghg

Required value is AdfjshxnjkAKLDKLJlk/ghg

How to remove \ this from the value. Is there any load runner inbuilt functions for this.

Lusitha
  • 330
  • 1
  • 3
  • 19
  • You can write any C code you like but it sounds strange that this is actually a problem. – Buzzy Aug 13 '17 at 06:45
  • yes this is a problem when I try to send value as it is it fails and not sure how but browser is smart enough to send the value excluding the "\" – Lusitha Aug 13 '17 at 07:00

1 Answers1

0

I had a similar problem that I solved by storing the correlated parameter as a string variable and then using a replace function to parse and replace the characters I didn't need.

Only problem is I was using JavaScript as my scripting language in VuGen so my code specifics wouldn't help you much. You might see about doing the same thing with C, or if switching to JS is plausible for you, mine looked similar to this:

var str = lr.evalString("{correlated_parameter}")

var corrected_string = str.replace(/\\/g, '');

My code used a different regular expression, but I think I have the syntax right for what you're trying to do, but I haven't tried this exact string of course.

Here's a link to another SO thread with more details on using the replace function.