how to get using web_reg_save_param to extract count in below case title="Warning (3)" (433 Views)
Frequent Advisor
Posts: 64
Registered: ‎12-17-2013
Message 1 of 2 (433 Views)
Accepted Solution

how to get using web_reg_save_param to extract count in below case title="Warning (3)"

[ Edited ]

I need to take count 3 below for warnings


how to get using web_reg_save_param 

output needed here  = warning count is 3




  <div class="staRow">
    <div class="staBar" title="Warning (3)">
      <div id="serStatusWarning" style="width:9%">&nbsp;</div>
    <div class="statusLabel">
      <a href="URL"
         title="View list of servers with health of WARNING (3)">
        Warning (3)</a>


else I have Warning images 3 on page, how to count images from loadrunner, can I do that ?

prod support

Smile tomorrow will be worse !!!
Please use plain text.
Frequent Advisor
Posts: 37
Registered: ‎04-11-2013
Message 2 of 2 (419 Views)

Re: how to get using web_reg_save_param to extract count in below case title="Warning (3)&quot

[ Edited ]

With web_reg_save_param you can retrieve a character or multiple characters from a stream of data.
You retrieve the string which is delimited by 2 boundaries.
A left boundary and a right boundary.
The characters between the boundaries are stored in a parameter.

For example:
If you would like to retrieve the text 'serStatusWarning', from your data, then you need a left boundary and a right boundary.
Left boundary like '<div id=\"' (Without the single qoutes, you need the extra backslash, in front of the doublequote, to let the Loadrunner compiler know, to interpret the next character as part of the boundary)
Right boundary like '\" style=\"' (Again without the single qoutes, again you need the extra backslashes)

Now Loadrunner knows to scan for the left boundary and save all the characters in a string untill Loadrunner retrieves the right boundary. The string is saved afterwords in a parameter. 


The statement looks like this:

	"LB=<div id=\"",
	"RB=\" style=\"",

Now to your case.
You would like to retrieve the text 'warning count is 3'.
But this text is not in your data.

So it can not be retrieved.


Probably you would like to retrieve only the 3.
There are multiple characters '3'.
Lets try to retrieve the first one.

Try this in your script:

	"LB=title=\"Warning (",


Also it is possible to retrieve multiple items.

Read the Function Reference there are a few examples.


Keep in mind that only a certain amount of characters can be retrieved.
You can control this with web_set_max_html_param_length.


/Edit: Typo's.

NB: If this solves your problem / helps you on the way, consider acknowledging with Kudos. To kudo a post, select the white star in the purple square by the post in the thread.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation