Quantcast
Channel: LoadRunner Practitioners Forum topics
Viewing all articles
Browse latest Browse all 3978

web_reg_sa​ve_param_r​egexp in Vugen

$
0
0

This is a crosspost, as I initially posted in the incorrect forum...

 

I'm having an issue using web_reg_save_param_regexp in Vugen. I need to grab the "href" parameter from the following HTML code:

 

<a href="/some/url/here/"><img src="/some/other/url/here.gif" border="0" align="absmiddle"/>
    Foo</a>

  

I have found this href parameter to be anywhere from the second to the fourteenth on the page, so using "ORDINAL=" to find the position doesn't work. As a result, I elected to use web_reg_save_param_regexp.

 

According to the web_reg_save_param_regexp reference in Vugen, a valid Perl regex will work in this function. I've built and tested the following regex, which correctly extracts the URL I'm looking for:

 

/href=\"(.+)\">.+Foo<\/a>/si

 

 

However, when I insert the following code into Vugen, it complains that the specified parameter can't be found:

 

web_reg_save_param_regexp("ParamName=Correlation1",
                          "RegExp=<a href=\"(.+)\".+Foo<\/a>",
                          LAST);

  

I assume that this is because the source HTML in the page spans multiple lines, but there does not appear to be an equivalent to Perl's "s" flag, which allows the regex to span multiple lines.

 

Unfortunately, the href is dynamicly generated each time the application runs, so I can't just hardcode it, and I am not the author of the webpage, so glomming all this together into one line in the page source is not an option.

 

Help? Am I missing flags for this function? Is there a better way to do this with a different web_reg_save_param_* function?

 

Thanks.

 

 

P.S. This thread has been moved from Application Perf Mgmt (BAC / BSM) Support and News Forum to LoadRunner Support Forum. -HP Forum Moderator

 

Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>