QTP - Settting value to Webedit

3,874 views
Skip to first unread message

langxii

unread,
Jun 8, 2011, 4:52:54 PM6/8/11
to QTP - HP Quick Test Professional - Automated Software Testing
I found a very good blog about setting value on Webedit. See below

Set desc =
Browser("title:=Gmail.*").Page("title:=Gmail.*").WebElement("class:=editabl­
e
LW-yrriRe", "html tag:=body")

desc.object.innertext = "this is a test email"


It is very good script but take so long to set value. Would you help
me to give different ways to set value webedit.

Thanks,

Leonardo Ribeiro Oliveira

unread,
Jun 8, 2011, 10:41:56 PM6/8/11
to mercu...@googlegroups.com
What you're doing is using programmatic description, and this is slow, but needed sometimes.

Why don't you use objects saved on object repository?

Regards,
Leonardo Ribeiro Oliveira

Bhuvan Sundar

unread,
Jun 9, 2011, 12:51:17 AM6/9/11
to mercu...@googlegroups.com
programmatic description is slow compare to write the Script by using objects which are in Object Repository. we have simple way to set the value WebEdit.
 
Browser("Wb_Brw_Google").Page("Wb_Pg_Google").WebEdit("Wb_Txt_Username").Set "mercury"
 
Here "Set" is the Keyword method in QTP,this is uesed to enter the value for any Text Box.
 
 
Thanks,
Bhuvan

--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

langxii

unread,
Jun 9, 2011, 12:19:18 PM6/9/11
to QTP - HP Quick Test Professional - Automated Software Testing
THanks for reply.
1) Yes i used Objects but it doesn't set value to webedit. (record
and playback). I think that is QTP problem

2) I have problem when i use the script above- it takes long time to
set value on grid. If i activate the application and code i am
running, it takes the value right away. If i doesn't activate (swicht)
between my application and code , it takes very long time to set value
to the grid and sometimes it doesnt set value.
So what is wrong with that? would you let me know.

3) I have 3 grids (3 webedits) and set values to webedit1, webedit 2,
webedit3. It take so long when it sets to each value. Is there any
good way i can learn? Please let me know..


Thanks,




On Jun 8, 9:51 pm, Bhuvan Sundar <bhuvan.sun...@gmail.com> wrote:
> programmatic description is slow compare to write the Script by using
> objects which are in Object Repository. we have simple way to set the value
> WebEdit.
>
> Browser("Wb_Brw_Google").Page("Wb_Pg_Google").WebEdit("Wb_Txt_Username").Se­t
> "mercury"
>
> Here "Set" is the Keyword method in QTP,this is uesed to enter the value for
> any Text Box.
>
> Thanks,
> Bhuvan
>
>
>
> On Thu, Jun 9, 2011 at 2:22 AM, langxii <betty200...@gmail.com> wrote:
> > I found a very good blog about setting value on Webedit.  See below
>
> > Set desc =
>
> > Browser("title:=Gmail.*").Page("title:=Gmail.*").WebElement("class:=editabl­­
> > e
> > LW-yrriRe", "html tag:=body")
>
> > desc.object.innertext = "this is a test email"
>
> > It is very good script but take so long to set value.  Would you help
> > me to give different ways to set value webedit.
>
> > Thanks,
>
> > --
> > You received this message because you are subscribed to the Google
> > "QTP - HP Quick Test Professional - Automated Software Testing"
> > group.
> > To post to this group, send email to Mercu...@googlegroups.com
> > To unsubscribe from this group, send email to
> > MercuryQTP+...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/MercuryQTP?hl=en- Hide quoted text -
>
> - Show quoted text -

Sreedhar

unread,
Jun 9, 2011, 10:27:59 PM6/9/11
to mercu...@googlegroups.com
Try to use "Type" instead of Set...hope this should be faster....
Are the webedits dynamic or static...?

Sreedhar Mallipeddi


Thanks,

-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1382 / Virus Database: 1513/3690 - Release Date: 06/09/11

Bhuvan Sundar

unread,
Jun 10, 2011, 1:09:19 AM6/10/11
to mercu...@googlegroups.com
did u notice the index in object Repositorty for these webedits.
 
i think 3 same webedits are available in the grid, then QTP identifying these webedits based on idex values.Pls check that.this .make the smart Identification as False in Object Repository.below code works fastly,try once.
 
Browser("Wb_Brw_Google").Page("Wb_Pg_Google").WebEdit("Wb_Txt_Username").Se­t "mercury"
 
Pl
Thanks,
Bhuvan


langxii

unread,
Jun 14, 2011, 7:21:10 PM6/14/11
to QTP - HP Quick Test Professional - Automated Software Testing
Thanks for reply.

I have 2 problems
1) Use the method below- doesn't set value.
Would you tell me how I can identify index values?
When I record there 3 webedits are same object WebEdit ("WebEdit"). If
i set to 3 values , the second grid and third grid can't set values,
it only set value "ABC"
Browser(").Page("").WebElement("WebResource_1").Click
Browser("").Page("").WebEdit("WebEdit").Set "ABC"
Browser(").Page("").WebElement("WebResource_1").Click
Browser("").Page("").WebEdit("WebEdit").Set "DEF"
....
2) Use Descriptive Progamming.- The value is set to First grid ,
second grid, third grid. But Those values doesn't store into database.
Set desc = Browser("").Page("").WebElement("WebResource_2")
desc.object.innertext = "01"

Browser("").Page("").WebButton("Save").Click ////This line after
clicking save those values are not stored in the database.

Save button does exit. I tried stop at the line (save button) and I
manually click Save button , those values didnot store.
Would you please help?
> > > >http://groups.google.com/group/MercuryQTP?hl=en-Hide quoted text -

kotesh reddy

unread,
Jun 21, 2011, 3:13:45 AM6/21/11
to mercu...@googlegroups.com
What is purpose of randum number
Reply all
Reply to author
Forward
0 new messages