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

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

SOLVED
Go to Solution
Frequent Advisor

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>
    <div class="statusLabel">
      <a href="URL"
         title="View list of servers with health of WARNING (3)">
        Warning (3)</a>
    </div>
  </div>

 

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

prod support
telecom

Smile tomorrow will be worse !!!
1 ACCEPTED SOLUTIONS
Highlighted
Trusted Contributor

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:

web_reg_save_param("Param_Name",
	"LB=<div id=\"",
	"RB=\" style=\"",
	LAST);

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:

web_reg_save_param("Param_Name",
	"LB=title=\"Warning (",
	"RB=)\">",
	LAST);

 

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 thumbs up icon in the purple square by the post in the thread.
1 REPLIES
Highlighted
Trusted Contributor

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:

web_reg_save_param("Param_Name",
	"LB=<div id=\"",
	"RB=\" style=\"",
	LAST);

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:

web_reg_save_param("Param_Name",
	"LB=title=\"Warning (",
	"RB=)\">",
	LAST);

 

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 thumbs up icon in the purple square by the post in the thread.