LoadRunner Support Forum
Showing results for 
Search instead for 
Do you mean 

API used for correlation - practical difference

Occasional Advisor

API used for correlation - practical difference



Can anyone briefly describe me practical differences between web_eg_save_param_regexp and web_reg_save_param_ex APIs used for correlation? I got technical solution form help but the description tells me nothing.



Valued Contributor

Re: API used for correlation - practical difference




sample response:
<nobr>loc=WORKFLOW&did=3478504B4B48694C37387341492B34663859667731673D3D&pdwid=&aid=1&pid=57776573596F6C38476F593D&tid=1|WORKFLOW|100000576||501|100|46|1|Order - 18366197 - New</nobr>



say you have a landing page in your application which has multiple orders...you want to correlate "did" but the pid,tid values change dynamically.

so in the example below i captured "did" where OrderNumber is 18366197 and the ordernumbers are in a parameter file say {OrderNumber}
you could do a regexp like this, which is the easiest way..




if you use regexp you have the power to choose a greedy or a lazy match to uniquely capture the value you want.  


web_reg_save_param_ex is an extension to what you traditionally have with wrsp. 


say if you want to correlate a ViewState, both ex1 and ex2 produce same results. 


you could do this ex1:


        "LB=id=\"__VIEWSTATE\" value=\"",


you could also do this  ex2:


        "RegExp=.*VIEWSTATE\" value=\"(.*?)\"",


traditional LB and RB will not always work for a complex response. if the value you want to capture is buried deep inside a response; where you cannot possibly have a static LB and RB, thats where you use regexp.





Occasional Advisor

Re: API used for correlation - practical difference

Thank you for your reply.


So please tell me what are the advantages of web_reg_save_param_ex in according to simpler and more flexible web_reg_save_param_regexp. If the web_reg_save_param_ex cannot be used to handle a complex response and deep buried values - for what it is - please give me some advantages or situation where it is better to use it.

HPE Expert

Re: API used for correlation - practical difference

In LoadRunner, regexp was introduced later than ex. RegExp is obviously more powerful than boundary based search. It's also recommanded to use regular expression if posible, it can do anything what ex version can do.

Of course, it also has 2 limitaiton,

1. user must have knowledge of regular expression.

2. a "VERY BAD" regular expression could consume unnecessary CPU time, even make the replay process hang. It's up to customer's skill set and requirement.


Re: API used for correlation - practical difference

web_reg_save_param() (with or without ex() ) is a good deal faster inside loadrunner itself. It may be less flexible, but it's definitely a lot simpler, especially if you're not familiar with regexpes.

It usually also covers about 99% of the correlations. ;-)
Discover the y-lib loadrunner support library: