-1

I've developed script in Load runner [ WEB HTTP/HTML ].

One of correlation parameter is left boundary of next correlation parameters

Can somebody help to provide the way to use previous correlation parameter value in next correlation parameter value's left boundary?

web_reg_save_param("documentHash", lr_eval_string("LB={token}"), "RB=')","Ordinal=1", LAST);
Sᴀᴍ Onᴇᴌᴀ
  • 8,218
  • 8
  • 36
  • 58
perftester
  • 11
  • 2
  • 5

2 Answers2

1

You can use your parameter in the left boundary like this:

web_reg_save_param("documentHash", lr_eval_string("LB={token}"), "RB=')", LAST);
Koby Douek
  • 16,156
  • 19
  • 74
  • 103
0

As I have already posted the code in the comments. I am the posting detailed answer with an example.

Example Website

In this example, we will take https://www.example.com to demonstrate the web_reg_save_param_ex();.

Here is the output of www.example.com. We will retrieve the marked text using the web_reg_save_param_ex();.

Example.com

Code

//Retrieving the first value.
//c_FirstValue will retrieve the string 'established'


web_reg_save_param_ex(
    "ParamName=c_FirstValue",
    "LB=This domain is",
    "RB=to be used",
    "Ordinal=1",
    SEARCH_FILTERS,
    LAST);

web_custom_request("web_custom_request",
    "URL=https://www.example.com",
    "Method=GET",
    "TargetFrame=",
    "Resource=0",
    "Referer=",
    "Body=",
    LAST);

lr_output_message("%s",lr_eval_string("{c_FirstValue}"));

//In this function, we are passing the c_FirstValue as a left boundary and retrieves the string 'to'

web_reg_save_param_ex(
    "ParamName=c_SecondValue",
    "LB={c_FirstValue}",
    "RB=be used",
    "Ordinal=1",
    SEARCH_FILTERS,
    LAST);

web_custom_request("web_custom_request",
    "URL=https://www.example.com",
    "Method=GET",
    "TargetFrame=",
    "Resource=0",
    "Referer=",
    "Body=",
    LAST);

lr_output_message("%s",lr_eval_string("{c_SecondValue}"));

Output Log

Starting iteration 1.
Maximum number of concurrent connections per server: 6      [MsgId: MMSG-26989]
Starting action Action.
Action.c(7): web_reg_save_param_ex started      [MsgId: MMSG-26355]
Action.c(7): Registering web_reg_save_param_ex was successful   [MsgId: MMSG-26390]
Action.c(15): web_custom_request("web_custom_request") started      [MsgId: MMSG-26355]
Action.c(15): web_custom_request("web_custom_request") was successful, 606 body bytes, 328 header bytes     [MsgId: MMSG-26386]
Action.c(24):  established 
Action.c(28): web_reg_save_param_ex started     [MsgId: MMSG-26355]
Action.c(28): Registering web_reg_save_param_ex was successful      [MsgId: MMSG-26390]
Action.c(36): web_custom_request("web_custom_request") started      [MsgId: MMSG-26355]
Action.c(36): Retrieving data from cache for "https://www.example.com"      [MsgId: MMSG-26558]
Action.c(36): web_custom_request("web_custom_request") was successful, 0 body bytes, 0 header bytes     [MsgId: MMSG-26386]
Action.c(45): to 
Ending action Action.
Ending iteration 1.
NaveenKumar Namachivayam
  • 1,163
  • 3
  • 25
  • 39