Ignore whitespace / newlines on left / right boundaries when using web_reg_save_param in loadrunner
Question ID: 104237
2
0

When setting up the LB and RB strings for capturing a dynamic value with web_reg_save_param(), is there a way to have the boundaries ignore whitespace and newlines?

EDIT (more info):

I’m trying to capture a dynamic value and the left bound would be the following (as returned by the server):

<div class="search-result clearfix">
                            <div class="left">
                                <h3><a href=".

I tried the following for the web_reg_save_param:

"LB=<div class=\\"search-result clearfix\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t<div class=\\"left\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<h3><a href=\\"."

This should account for the newlines and tabs, but I still don’t get matches. Anything I can do to get this left bound to work?

Thanks.

Marked as spam
Posted by (Questions: 9, Answers: 1)
Asked on September 30, 2010 5:45 pm
1099 views
Answers (6)
4
Private answer

Instead, I would take a different approach. You may have to grab a bigger chunk, and then parse it down using string functions in C to get to the real value that you need to capture. I would start by using the ORD argument in the web_reg_save_param to capture the nth occurence of the LB
<div class=''left''>
(you will have to figure out which n occurence you need), using the same RB. Then take the resulting string and parse it for the occurence of

<h3><a href=''.

You should be able use this approach to eventually parse down to the part of the string you are interested in capturing.

Marked as spam
Posted by (Questions: 36, Answers: 3)
Answered on October 1, 2010 8:41 pm
0
Thanks, I had actually done a workaround with just using the h3 tag and href tag part and ORD arguments already since these are all search results and luckily they are the only entities that use that h3 tag ,so that works for this specific project. I was more curious on if there were other options to get this to work properly and be more accurate with the bounds.
( at October 4, 2010 3:31 pm)
1
Private answer

For LB you could just include the last string `

Marked as spam
Posted by (Questions: 0, Answers: 1)
Answered on July 11, 2011 5:39 am
1
Private answer

I faced the same problem as mentioned,and even i tried with multiple ways of using string functions but as i was new to the language i couldnt make it .

But the solution that helped me is saveLen and SaveOffset paramaters in web_reg_save_param function.

In the mentioned case initially i used as '''' LB and '''''' as RB and then i found the position of required value and then placed the value in saveOffset.

Marked as spam
Posted by (Questions: 0, Answers: 1)
Answered on March 1, 2017 6:32 am
0
Private answer

Hello Cab,

Please let me know if you found a workaround for capturing multiple lines. I am trying to capture what is shown below,

Marked as spam
Posted by (Questions: 0, Answers: 2)
Answered on September 6, 2012 11:45 am
0
Private answer

Please let me know if you found a workaround for capturing multiple lines. I am trying to capture what is shown below.

Marked as spam
Posted by (Questions: 0, Answers: 2)
Answered on September 6, 2012 11:48 am
0
Private answer

From below text, I need the get the value ''56767 - Business Apps'' How to specify the LB and the RB. LB and RB are in different lines. We cant take LB as''value='' because there are many other data with same value. We have to specify the LB as ''name=''billToDept'' ''. Please Suggest

readOnly=''readOnly'' id=''departmentName_0? name=''billToDept''
value=''56767 - Business Apps'' title=''56767 - Business Apps''

Marked as spam
Posted by (Questions: 0, Answers: 1)
Answered on February 23, 2018 8:51 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top