Issue with web_reg_find

446 views
Skip to first unread message

shakti sareen

unread,
Dec 9, 2011, 7:12:10 AM12/9/11
to LoadRunner
Step 1: web_reg_find("Search=Body","Text=Blue Sky
Air","SaveCount=Count",LAST);

Step 2: nFound= atoi( lr_eval_string("{Count}"));

Step 3: if (nFound>0)

Step 4: {
Step 5: lr_output_message("Text Check
Occurance is correct i.e. %d", nFound);
Step 6: }
Step 7: else {lr_output_message("Text Check incorect i.e. %d",
nFound);
Step 8: }

In above script, for first step, i am getting value of "count" as "4"
with the help of savecount functionality which is being displayed in
Extended log.

Now after converting count value into int with the help of atoi
function and storing the value in "nFound", getting output as "Text
Check incorect i.e. 0" which means nFound taking value as zero from
step 2

Prajeesh Nair

unread,
Dec 10, 2011, 4:02:16 AM12/10/11
to LR-Loa...@googlegroups.com
I don't see anything wrong in your code.

I wrote a piece of code myself to check and it works fine
 
 
int nFound;

lr_save_string("10", "saveCount");
nFound = atoi(lr_eval_string("{saveCount}"));
if (nFound>0) {
lr_output_message("Text check correct");
}else{
lr_output_message("Text check incorrect"); 
 

Check your code once again. More over, are you sure its value should be more than 0? 

shyam sunder byreddy

unread,
Dec 12, 2011, 5:02:30 AM12/12/11
to lr-loa...@googlegroups.com

Hi Shakti,

 

There is an error in your code, U are directly converting it from LR value to C value but saving anywhere, and hence it is showing the output as ZERO.

 

Well, here I would like to say something to all the group members,

When anyone asking for any kind of help, you should follow some email etiquettes like addressing the group (Hi All) and politely requesting the group for help.

 

These things will really need to be maintained in a professional field.

 

Shakti, No Heart feelings this suggestion is for ALL as well.

 

I hope u will maintain the protocol next time :)

 

~Shyam


--
You received this message because you are subscribed to the Google "LoadRunner" group.
To post to this group, send email to LR-Loa...@googlegroups.com
To unsubscribe from this group, send email to
LR-LoadRunne...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/LR-LoadRunner?hl=en

Prajeesh Nair

unread,
Dec 12, 2011, 12:55:57 PM12/12/11
to LR-Loa...@googlegroups.com, lr-loa...@googlegroups.com
You suggest saying "converting LR  value to C" is the issue. Would you please mind elaborating a little more, because I still don't see any issue with the script.

loadrunner

unread,
Dec 13, 2011, 6:01:29 AM12/13/11
to LoadRunner
Try this code in your Step 2 sir

nFound= atoi(strlen(lr_eval_string("{Count}")));

Goodluck !

On Dec 12, 3:02 pm, shyam sunder byreddy <shyambyre...@gmail.com>
wrote:


> Hi Shakti,
>
> There is an error in your code, U are directly converting it from LR value
> to C value but saving anywhere, and hence it is showing the output as ZERO.
>
> Well, here I would like to say something to all the group members,
>
> When anyone asking for any kind of help, you should follow some email
> etiquettes like addressing the group (Hi All) and politely requesting the
> group for help.
>
> These things will really need to be maintained in a professional field.
>
> Shakti, No Heart feelings this suggestion is for ALL as well.
>
> I hope u will maintain the protocol next time :)
>
> ~Shyam
>

gkmishr...@gmail.com

unread,
Dec 13, 2011, 6:09:17 AM12/13/11
to lr-loa...@googlegroups.com
Suppose count is zero. Change it in string means '0' and its length should be 1. I think it will not work at this point.

Sent from my HTC

piyush gupta

unread,
Dec 13, 2011, 11:09:08 AM12/13/11
to lr-loa...@googlegroups.com
You need to always remember that web_reg_find functioni is a  registery function so  a request to search for a text string on a Web page retrieved by the next action function, such as web_url. so your order should be like this
Step 1: web_reg_find("Search=Body","Text=Blue Sky
Air","SaveCount=Count",LAST);
Step 2: web_url(xyz,...); // this is the action function
Step 3:       nFound= atoi(  lr_eval_string("{Count}"));
Step 4:        if (nFound>0)
Step 5:                      {
Step 6:                             lr_output_message("Text Check

Occurance is correct i.e. %d", nFound);
Step 7:                  }
Step 8:                 else {lr_output_message("Text Check incorect i.e. %d",
nFound);
Step 9:                 }
 
 
Now it will not show count 0. in the replay log it is showing correct 4 just you need to understand the meaning of registry function.
 
You received this message because you are subscribed to the Google "LoadRunner" group.
To post to this group, send email to LR-Loa...@googlegroups.com
To unsubscribe from this group, send email to
LR-LoadRunne...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/LR-LoadRunner?hl=en
 


On Mon, Dec 12, 2011 at 11:25 PM, Prajeesh Nair <praje...@gmail.com> wrote:
You suggest saying "converting LR  value to C" is the issue. Would you please mind elaborating a little more, because I still don't see any issue with the script.

--

Gaurav Mishra

unread,
Dec 13, 2011, 12:32:13 PM12/13/11
to lr-loa...@googlegroups.com
OH nice one guptee ....... did not clicked me at first sight .

shyam sunder byreddy

unread,
Dec 14, 2011, 5:15:15 AM12/14/11
to lr-loa...@googlegroups.com
Hey Kumar,
 

This is not the solution, u are trying to print length of the string, but our friend Shakthi is trying to find the count value J

Message has been deleted
Message has been deleted

Suresh Reddy

unread,
Dec 14, 2011, 12:05:58 PM12/14/11
to LoadRunner
Hi Shyam,

I think you should first attend a training on email etiquette's. I
have read few of your posts and its a waste of time.

I think all members on this forum are here to clarify their doubts
about Load Runner or testing but you seem to be teaching them business
etiquette's.

Please check the below line - "Shakti, No Heart feelings this


suggestion is for ALL as well."

Its "Hard" feelings and not heart feelings. I think you should
concentrate on English and Testing since u seems to be a novice in
both fields.

Thanks,
Suresh Reddy.

On Dec 12, 3:02 pm, shyam sunder byreddy <shyambyre...@gmail.com>
wrote:

> Hi Shakti,
>
> There is an error in your code, U are directly converting it from LR value
> to C value but saving anywhere, and hence it is showing the output as ZERO.
>
> Well, here I would like to say something to all the group members,
>
> When anyone asking for any kind of help, you should follow some email
> etiquettes like addressing the group (Hi All) and politely requesting the
> group for help.
>
> These things will really need to be maintained in a professional field.
>
> Shakti, No Heart feelings this suggestion is for ALL as well.
>
> I hope u will maintain the protocol next time :)
>
> ~Shyam
>

shyam sunder byreddy

unread,
Dec 15, 2011, 12:16:50 AM12/15/11
to lr-loa...@googlegroups.com

Well Suresh, this is a perfectly “Professional” cluster and fully loaded with well educated individuals. Coming to the point, I’m not correcting/pointing anyone’s grammar as YOU are trying to do.  And remember here nobody is customer nor no one is getting paid for their replies to others. Hence in that case, if we are not maintaining some courtesy, does it show your professional approach? I’m NOT criticizing anyone just trying to help!!!

Moreover I have NOT seen your postings anywhere, STOPPING commenting and starting helping if possible.

If YOU think that my answers are INCORRECT for the postings then why can’t you reply the right one?

Note: I have tried to help Mr. Shakti and then suggested few email communication techniques.

~Shyam

loadrunner

unread,
Dec 15, 2011, 4:37:53 AM12/15/11
to LoadRunner
Sorry, i miss understand your question

you better implement C code for String copy(Where you copy Count into
string) and string compression function(To Compare your Actual value
with expected)

Try it

On Dec 14, 3:15 pm, shyam sunder byreddy <shyambyre...@gmail.com>
wrote:


> Hey Kumar,
>
> This is not the solution, u are trying to print length of the string, but
> our friend Shakthi is trying to find the count value J
>

loadrunner

unread,
Dec 15, 2011, 5:04:15 AM12/15/11
to LoadRunner
Try this below code

int i;
char Str[1];

your Web_reg_find()
Web_submit_data();
{
XYZ.......
}
i= atoi(strcpy(Str,lr_eval_string("{Welcome_Count}")));
lr_output_message("Copied String:% s",Str);
lr_output_message("Count value:% d",i);

if you wanna keep your if condition you can implement...For now i am
not doing

Your log should display the below
Action.c(1218): Registered web_reg_find successful for
"Text=XYZ" (count=7)
Action.c(1218): Notify: Saving Parameter "Welcome_Count = 7"
web_submit_data("XXXXXXXX") was successful, 6193 body bytes, 718
header bytes
Notify: Parameter Substitution: parameter "Welcome_Count" = "7"
Copied String:7
Count value: 7

Anybody have any questions?

loadrunner

unread,
Dec 15, 2011, 5:10:21 AM12/15/11
to LoadRunner
Count=0 means your Text Check is failed anyway

On Dec 13, 4:09 pm, "gkmishragau...@gmail.com"

loadrunner

unread,
Dec 15, 2011, 5:10:44 AM12/15/11
to LoadRunner
Thanks for Correcting me

On Dec 14, 3:15 pm, shyam sunder byreddy <shyambyre...@gmail.com>
wrote:


> Hey Kumar,
>
> This is not the solution, u are trying to print length of the string, but
> our friend Shakthi is trying to find the count value J
>

pramod phophalia

unread,
Dec 15, 2011, 7:11:17 AM12/15/11
to lr-loa...@googlegroups.com
Hi Shakti,

Below code would not work.Actually while you write the web_reg_find function it says that you are registering the some text and telling to server that I am expecting some text in the consecutive request.

So in order to make the below code to work,I would say Keep the step2 to 8 after the request..For Eg :

int nFound;

web_url("logon.htm", 
"TargetFrame=", 
"Resource=0", 
"RecContentType=text/html", 
"Referer=", 
"Snapshot=t1.inf", 
"Mode=HTML", 
LAST);

    web_reg_find("Search=Body","Text=Blue Sky Air","SaveCount=Count",LAST);
web_url("logon.htm_2", 
"TargetFrame=", 
"Resource=0", 
"RecContentType=text/html", 
"Referer=", 
"Snapshot=t2.inf", 
"Mode=HTML", 
LAST);

nFound= atoi(lr_eval_string("{Count}"));

if (nFound>0)

{
lr_output_message("Text Check Occurance is correct i.e. %d", nFound);
    }
else 
{
lr_output_message("Text Check incorect i.e. %d",nFound);
}

return 0;

Now Enjoy :)

Thanks
Pramod

Suresh Reddy

unread,
Dec 15, 2011, 7:33:59 AM12/15/11
to LoadRunner
Hi Shyam,

Please don't get excited and impatient.

I can perfectly understand that what state of mind you are going
through right now.

Please try to understand if you can that posting number of answers on
this forum doesn't mean that whatever you are saying is right.

You should learn to maintain the quality of content and your language
as well.

Hope you could understand.

Thanks,
Suresh Reddy.

On Dec 15, 5:11 pm, pramod phophalia <pramodphopha...@gmail.com>
wrote:

gkmishr...@gmail.com

unread,
Dec 15, 2011, 5:22:40 AM12/15/11
to lr-loa...@googlegroups.com
No dude in this case it does no mean failed. Cause count will come zero anyways cause till then request function is not started.

Once request function will come , it will be checked and pass but still count will remain zero.

I saw ur other solution, that is quiet useful and give useful values to count.


Sent from my HTC

----- Reply message -----
From: "loadrunner" <vkumar...@gmail.com>
To: "LoadRunner" <LR-Loa...@googlegroups.com>
Subject: Issue with web_reg_find
Date: Thu, Dec 15, 2011 3:40 pm


Count=0 means your Text Check is failed anyway

On Dec 13, 4:09 pm, "gkmishragau...@gmail.com"
<gkmishragau...@gmail.com> wrote:
> Suppose count is zero. Change it in string means '0' and its length should be 1. I think it will not work at this point.
>
> Sent from my HTC
>
> ----- Reply message -----
> From: "loadrunner" <vkumar.av...@gmail.com>
> To: "LoadRunner" <LR-Loa...@googlegroups.com>
> Subject: Issue with web_reg_find
> Date: Tue, Dec 13, 2011 4:31 pm
>
> Try this code in your Step 2 sir
>
> nFound= atoi(strlen(lr_eval_string("{Count}")));
>
> Goodluck !
>
> On Dec 12, 3:02 pm, shyam sunder byreddy <shyambyre...@gmail.com>
> wrote:
>
>
>
> > Hi Shakti,
>
> > There is an error in your code, U are directly converting it from LR value
> > to C value but saving anywhere, and hence it is showing the output as ZERO.
>
> > Well, here I would like to say something to all the group members,
>
> > When anyone asking for any kind of help, you should follow some email
> > etiquettes like addressing the group (Hi All) and politely requesting the
> > group for help.
>
> > These things will really need to be maintained in a professional field.
>
> > Shakti, No Heart feelings this suggestion is for ALL as well.
>
> > I hope u will maintain the protocol next time :)
>
> > ~Shyam
>
> > On Sat, Dec 10, 2011 at 2:32 PM, Prajeesh Nair <prajeesh...@gmail.com>wrote:
>
> > > I don't see anything wrong in your code.
>
> > > I wrote a piece of code myself to check and it works fine
>
> > > int nFound;
>
> > > lr_save_string("10", "saveCount");
> > > nFound = atoi(lr_eval_string("{saveCount}"));
> > > if (nFound>0) {

> > > lr_output_message("Text check correct");
> > > }else{
> > > lr_output_message("Text check incorrect");
>
> > > Check your code once again. More over, are you sure its value should be
> > > more than 0?
>
Message has been deleted

Allen Qin

unread,
Dec 15, 2011, 12:47:50 AM12/15/11
to LoadRunner
Well, I think I agree with Shyam on this. One should show a bit
courtesy while asking a favour from others. /Allen

On Dec 15, 4:16 pm, shyam sunder byreddy <shyambyre...@gmail.com>
wrote:
> Well Suresh, this is a perfectly “*Professional*” cluster and fully loaded


> with well educated individuals. Coming to the point, I’m not
> correcting/pointing anyone’s grammar as YOU are trying to do.  And remember

> here *nobody is customer* nor *no one is getting paid for their replies to
> others*. Hence in that case, if we are not maintaining some courtesy, does


> it show your professional approach? I’m NOT criticizing anyone just trying
> to help!!!
>
> Moreover I have NOT seen your postings anywhere, STOPPING commenting and
> starting helping if possible.
>
> If YOU think that my answers are INCORRECT for the postings then why can’t
> you reply the right one?
>

> *Note*: I have tried to help Mr. Shakti and then suggested few email
> communication techniques.
>
> ~Shyam

shyam sunder byreddy

unread,
Dec 15, 2011, 8:48:25 AM12/15/11
to lr-loa...@googlegroups.com

STOP commenting and START helping others postings which u have NOT done so far.

People like you are IGNOREABLE.

~Shyam

Suresh Reddy

unread,
Dec 15, 2011, 8:56:52 AM12/15/11
to LoadRunner
Hi Shyam,

I am definitely going to answer the posts. By the way it is
"ignorable" and not "ignoreable".

You should not use caps as it signifies that you are shouting. Take a
chill pill dude. :)

Thanks,
Suresh Reddy.

On Dec 15, 6:48 pm, shyam sunder byreddy <shyambyre...@gmail.com>
wrote:


> STOP commenting and START helping others postings which u have NOT done so
> far.
>
> People like you are IGNOREABLE.
> ~Shyam
>

> On Thu, Dec 15, 2011 at 6:03 PM, Suresh Reddy <imsureshre...@gmail.com>wrote:
>
> > Hi Shyam,
>
> > Please don't get excited and impatient.
>
> > I can perfectly understand that what state of mind you are going
> > through right now.
>
> > Please try to understand if you can that posting number of answers on
> > this forum doesn't mean that whatever you are saying is right.
>
> > You should learn to maintain the quality of content and your language
> > as well.
>
> > Hope you could understand.
>
> > Thanks,
> > Suresh Reddy.
>
> > On Dec 15, 5:11 pm, pramod phophalia <pramodphopha...@gmail.com>
> > wrote:
> >  > Hi Shakti,
>
> > > Below code would not work.Actually while you write the web_reg_find
> > > function it says that you are registering the some text and telling to
> > > server that I am expecting some text in the consecutive request.
>
> > > So in order to make the below code to work,I would say Keep the step2 to
> > 8
> > > after the request..For Eg :
>
> > > int nFound;
>
> > > web_url("logon.htm",

> > > "URL=https://XXXXXXXXXXXXXXXXXXXXXXXXX<https://xxxxxxxxxxxxxxxxxxxxxxxxx/>


> > ",
> > > "TargetFrame=",
> > > "Resource=0",
> > > "RecContentType=text/html",
> > > "Referer=",
> > > "Snapshot=t1.inf",
> > > "Mode=HTML",
> > > LAST);
>
> > >     web_reg_find("Search=Body","Text=Blue Sky
> > Air","SaveCount=Count",LAST);
> > >  web_url("logon.htm_2",

> > > "URL=https://XXXXXXXXXXXXXXXXXXXXXXXXX<https://xxxxxxxxxxxxxxxxxxxxxxxxx/>

gkmishr...@gmail.com

unread,
Dec 15, 2011, 9:21:55 AM12/15/11
to lr-loa...@googlegroups.com
Come on guys

Suresh u r not his english teacher, let him help other in the way he want.

Shyam if some one is telling you somthing then listen. He put a valid point . Your knowledge is good why not you are presenting it in better ways.

Sent from my HTC

----- Reply message -----
From: "Suresh Reddy" <imsure...@gmail.com>
To: "LoadRunner" <LR-Loa...@googlegroups.com>
Subject: Issue with web_reg_find

shyam sunder byreddy

unread,
Dec 15, 2011, 12:17:34 PM12/15/11
to lr-loa...@googlegroups.com

Suresh, yes you are novice and in experienced in this professional field of Load Runner. If not prove your technical skills by answering the postings of others.

Hope you know that is NOT such simple as commenting othersJ.

Allen, he is not Indian but still supported me since I did not pass any wrong statements. But did anyone support you? You must understand at least now.

Prove your Technical Skills if you are worth…

Thanks,
Shyam

Veera VSN Mathala

unread,
Dec 15, 2011, 12:18:53 PM12/15/11
to lr-loa...@googlegroups.com

Please stop this discussion, please.

James Pulley

unread,
Dec 15, 2011, 3:49:12 PM12/15/11
to LoadRunner
This thread is declared dead: Any posts which make it through
moderation will be deleted from the archive.

Fair warning. Anyone found to be harrassing other members through
their private email from the time of this posting will be summarily
banned from the forum for misconduct. If they are found to be members
of any other forums I manage I will ban them from there as well
(YahooGroups, LinkedIn, SQAForums, GoogleGroups....)

Reply all
Reply to author
Forward
0 new messages