The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> HP / Mercury LoadRunner

Pages: 1 | 2 | >> (show all)
Loverguy1
stranger


Reged: 08/14/06
Posts: 57
Capture a dynamic value on HTML page
      #446221 - 01/07/08 08:43 AM

1. What version of LoadRunner (LR) or PerformanceCenter (PC) are you using? (specify which tool LR or PC)
LR 8.1.4

2. What is the protocol you are recording?
Web (HTTP/HTML)

3. If HTML - are you using HTML-Advanced with URLs or,
yes, URLs

4. If URL mode:
- Concurrent groups, or
- Without Concurrent groups?
Without Concurrent Groups

5. Which LoadRunner/PerformanceCenter feature (FPs) or service packs are you using?
None

6. VuGen Recording - are you using Old or New Recording Engine?
New

7. What kind of LoadRunner license do you have -
- Subscription,
- Perpetual,
- Permanent/Unlimited
- Virtual User days, or
- Evaluation?
Permanent/Unlimited

8. If subscription, is subscription current or expired?
N/A

9. What platform(s) (PCs) and Operating Systems (Windows-XP, etc.)? Include version and service packs (SP1 or 2, etc.)
PC - Windows XP

10. If you have filed a service request with HP/Mercury, what have they told you at this point with respect to your issue?
I have raised a service case with HP, no reply yet.

I'm trying to capture a value on HTML page using a weg_reg_find here's the code:
web_reg_find("Text/IC=Request #</h3></td>\r\n"
"\r\n"
"\t\t\t\t<td class=\"field\">{webrequestno}",
"SaveCount=100",
"Search=Body",
LAST);

But in the replay log, it shows :
Schedule_Pickup.c(6): Notify: Parameter Substitution: parameter "webrequestno" = "28105"

Well actually, the value should be "2292715".
Don't know where am i getting this value from?
Can someone please help me the resolve this issue.


Post Extras: Print Post   Remind Me!   Notify Moderator  
terri c
Active Member


Reged: 08/07/03
Posts: 807
Loc: Atlanta
Re: Capture a dynamic value on HTML page [Re: Loverguy1]
      #446225 - 01/07/08 08:57 AM

Are you trying to save the web request number from the response? If so, I think you need to look into using web_reg_save_param instead of web_reg_find. Check the function reference out (and the many posts on this site) for information on how to use it.

-Terri


Post Extras: Print Post   Remind Me!   Notify Moderator  
DanCorey
Member


Reged: 08/09/02
Posts: 262
Re: Capture a dynamic value on HTML page [Re: terri c]
      #446227 - 01/07/08 09:05 AM

Press F4 and turn extended logging on (server response) and check your server response. Do a search for the value you're getting and the one you think you should have.

This should get you closer to your answer

--------------------
-- Dan

Loadrunner information link


Post Extras: Print Post   Remind Me!   Notify Moderator  
sbhatta904
Member


Reged: 10/18/02
Posts: 32
Loc: Jersey City, NJ, USA
Re: Capture a dynamic value on HTML page [Re: Loverguy1]
      #446245 - 01/07/08 10:24 AM

terri_c is correct...you are using the wrong function. The function which you are using is also incorrect..in that the SaveCount={parameter} should have a parameter which holds the number of occurrances of the aforementioned text. You can use that returned value to create logical constructs afterwards. The web_reg_find function is used verify content of a page "after it is rendered" not while rendering..you should use web_reg_save_param.

--------------------
AutoRules


Post Extras: Print Post   Remind Me!   Notify Moderator  
Loverguy1
stranger


Reged: 08/14/06
Posts: 57
Re: Capture a dynamic value on HTML page [Re: sbhatta904]
      #446317 - 01/07/08 01:07 PM

Thanks for the suggestion, i used web_reg_save_param. How can i dump this parameter in a file.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Peter Ruscoe
Veteran


Reged: 03/18/02
Posts: 7686
Loc: Tampa Bay
Re: Capture a dynamic value on HTML page [Re: Loverguy1]
      #446328 - 01/07/08 01:49 PM

Look at the file handling functions in C.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Loverguy1
stranger


Reged: 08/14/06
Posts: 57
Re: Capture a dynamic value on HTML page [Re: Peter Ruscoe]
      #446385 - 01/07/08 07:19 PM

what should be the left and right boundaries:

<td class="label"><h3>Request #</h3></td>

<td class="field">2293037</td>

I just want "2293037" value. please help.


Post Extras: Print Post   Remind Me!   Notify Moderator  
kiranbadi1991
Super Member


Reged: 12/03/06
Posts: 1937
Re: Capture a dynamic value on HTML page [Re: Loverguy1]
      #446406 - 01/07/08 10:28 PM

LB="<td class="field">"
RB="</td>"
escape the special characters with backslash, if you have more values with same LB and RB, then use ord=All and then turn on extended logging and select parameter sub,see the logs and the value which you require and replace this value in the script.If this is not your requirement, then string tokeniser might be your solution.


Post Extras: Print Post   Remind Me!   Notify Moderator  
mishrade
Junior Member


Reged: 03/10/06
Posts: 83
Re: Capture a dynamic value on HTML page [Re: Loverguy1]
      #446408 - 01/07/08 10:29 PM

Try LB="<td class=\"field\">" and RB="</td>"

Thanks,
-Debabrata

--------------------
--->A slow order processing engine necessarily means slowly processed orders.

My LR Profile:-

http://www.sqaforums.com/showflat.php?Ca...true#Post409718


Post Extras: Print Post   Remind Me!   Notify Moderator  
Loverguy1
stranger


Reged: 08/14/06
Posts: 57
Re: Capture a dynamic value on HTML page [Re: mishrade]
      #446559 - 01/08/08 06:36 AM

The problem there are lotsa <td class=\"field\">" in the HTML page, so can't use that. when i try to use left bound as Request #</h3></td> <td class="field">, it gives error no boundary exists.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Chid
Active Member


Reged: 06/27/06
Posts: 812
Loc: USA
Re: Capture a dynamic value on HTML page [Re: Loverguy1]
      #446565 - 01/08/08 06:43 AM

Quote:

The problem there are lotsa <td class=\"field\">" in the HTML page, so can't use that. when i try to use left bound as Request #</h3></td> <td class="field">, it gives error no boundary exists.




There should be a carriage_return/new_line (/r/n) (ah.. i miss my typewriting days ) characters in between the </td> and the <td>

When you run the script with logs turned on to capture the server response, it will tell you how many /r/n (or is it \r\n ?) characters to put in between the </td> and <td>

Also keep in mind that you may have to put escape slashes on them so it could be \\r\\n in between the td tags.

--------------------
Chid | My LR Profile | LoadRunner Reading


Post Extras: Print Post   Remind Me!   Notify Moderator  
ptrussell_ncModerator
Super Member


Reged: 01/17/06
Posts: 1636
Loc: Charlotte, NC
Re: Capture a dynamic value on HTML page [Re: Chid]
      #446599 - 01/08/08 07:56 AM

If you can't uniquely identify the instance you want, you are going to have to capture too much and then use C to parse out the data that you actually need.

--------------------
Unless you are writing a compiler, strtok is NOT the answer.
See: http://www.sqaforums.com/showflat.php?Cat=0&Number=541641&Main=541641#542222

QAF is still an exercise in self-sufficiency! (Thank JB!)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Loverguy1
stranger


Reged: 08/14/06
Posts: 57
Re: Capture a dynamic value on HTML page [Re: ptrussell_nc]
      #446605 - 01/08/08 08:10 AM

Tried to use Left Boundary:
"LB=Request #</h3></td>\\r\\n\\r\\n\\t\\t\\t\\\t<td class=\"field\">",

It gives error:Schedule_Pickup.c(13): Error -26377: No match found for the requested parameter "RequestNo". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]


Is this the correct boundary specification??


Post Extras: Print Post   Remind Me!   Notify Moderator  
Loverguy1
stranger


Reged: 08/14/06
Posts: 57
Re: Capture a dynamic value on HTML page [Re: Loverguy1]
      #446608 - 01/08/08 08:16 AM

the server response shows:
Schedule_Pickup.c(13): \t\t<td class="label"><h3>Request #</h3></td>\r\n
Schedule_Pickup.c(13): \r\n
Schedule_Pickup.c(13): \t\t\t\t<td class="field">2293142</td>\r\n


Post Extras: Print Post   Remind Me!   Notify Moderator  
terri c
Active Member


Reged: 08/07/03
Posts: 807
Loc: Atlanta
Re: Capture a dynamic value on HTML page [Re: Loverguy1]
      #446611 - 01/08/08 08:39 AM

Quote:

"LB=Request #</h3></td>\\r\\n\\r\\n\\t\\t\\t\\\t<td class=\"field\">",




If you copied this directly from your script, I think you may have an extra \

Try this:

"LB=Request #</h3></td>\\r\\n\\r\\n\\t\\t\\t\\t<td class=\"field\">",


Post Extras: Print Post   Remind Me!   Notify Moderator  
Chid
Active Member


Reged: 06/27/06
Posts: 812
Loc: USA
Re: Capture a dynamic value on HTML page [Re: terri c]
      #446615 - 01/08/08 08:49 AM

I think you can skip the \\t characters (for Tab)

If the one provided by terri does not work try using

"LB=</h3></td>\\r\\n\\r\\n<td class=\"field\">",

--------------------
Chid | My LR Profile | LoadRunner Reading


Post Extras: Print Post   Remind Me!   Notify Moderator  
Loverguy1
stranger


Reged: 08/14/06
Posts: 57
Re: Capture a dynamic value on HTML page [Re: terri c]
      #446628 - 01/08/08 09:04 AM

it didn't worked.

Schedule_Pickup.c(15): Error -26377: No match found for the requested parameter "RequestNo". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 2048 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
Schedule_Pickup.c(15): Notify: Saving Parameter "RequestNo = "


Post Extras: Print Post   Remind Me!   Notify Moderator  
Loverguy1
stranger


Reged: 08/14/06
Posts: 57
Re: Capture a dynamic value on HTML page [Re: Loverguy1]
      #446632 - 01/08/08 09:10 AM

Neither of the solution worked, still gives same error please help me out.

Post Extras: Print Post   Remind Me!   Notify Moderator  
terri c
Active Member


Reged: 08/07/03
Posts: 807
Loc: Atlanta
Re: Capture a dynamic value on HTML page [Re: Loverguy1]
      #446634 - 01/08/08 09:12 AM

Try removing the escapes for the \r and \n.

As ptrussel suggested above - If nothing works, you will have to capture both the label and value seperately and add some code to cycle through all of them until you find the Request #

Code:

web_reg_save_param("Label","LB=td class=\"label\"><h3>","RB=</h3></td>","ORD=ALL",LAST);

web_reg_save_param("Field","LB=td class=\"field\">","RB=</td>","ORD=ALL",LAST);



Add a loop and code to search through Label until you find that Label equals Request #. Once you find that you can use the Field parameter to get the number out.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Chid
Active Member


Reged: 06/27/06
Posts: 812
Loc: USA
Re: Capture a dynamic value on HTML page [Re: terri c]
      #446718 - 01/08/08 11:30 AM

Have you tried using "LB=class=\"field\">" with ORD = ALL and confirmed that the number you want to capture does NOT always appear at the same Ordinal in every run?

If it appears in the same order everytime, we are banging our heads over a non-issue.


Also to trouble shoot this further, can you use ORD=ALL , turn paramterisation on, and post the captured variables here?

--------------------
Chid | My LR Profile | LoadRunner Reading


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1 | 2 | >> (show all)



Extra information
0 registered and 32 anonymous users are browsing this forum.

Moderator:  AJ, James Pulley, ptrussell_nc, JimHowell1970 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 2553

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5