Re: how to write code for to select checkbox in webtable?

5,008 views
Skip to first unread message

qtptest applications

unread,
Mar 8, 2013, 10:48:10 AM3/8/13
to mercu...@googlegroups.com
Hello Thrinath,

This is how you can do that

Browser(...).Page(...).Webtable(...).childitem(...).Set "ON"

Thanks,
QtpTestApplications

On Fri, Mar 8, 2013 at 3:45 AM, Thrinath <nani.t...@gmail.com> wrote:


Hi,

i would like to write a following functionality in descriptive
i need to select an item in Inbox(gmail), it shows as web element inside the table

Browser("name:= Inbox.*").Page("title:= Inbox.*")......?????????


attached screenshot(i just want to select an item in Inbox)

Regards,
Thrinath

--
--
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
 
---
You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mercuryqtp+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Nani

unread,
Mar 8, 2013, 9:10:33 PM3/8/13
to mercu...@googlegroups.com
Hi,

Still QTP not able to identify this following code!

Browser("name:= Gmail.*").Page("title:= Gmail.*").WebEdit("name:= Email").Set "thrinath.digitek"
Browser("name:= Gmail.*").Page("title:= Gmail.*").WebEdit("name:= Passwd").SetSecure "513a911ba0b0f02dff0e5bfef02554d110ea18341ae862d58ef54c1d5b8e28ac8cdb"
Browser("name:= Gmail.*").Page("title:= Gmail.*").WebButton("name:= Sign in").Click
Browser("name:= Inbox.*").Page("title:= Inbox.*").WebTable("innertext:= Techgig.*").ChildItem(1,1, "WebElement", 0).Set "ON"

Regards,
Thrinath

gaurav sharma

unread,
Mar 22, 2013, 3:30:37 AM3/22/13
to mercu...@googlegroups.com
Hi Nani,

Can u pls tell me what object u want to select in the web page and why you are using ChildItem Method?

Regards,
Gaurav
GAURAV SHARMA
S/W ENGG.
ACCENTURE

Venkat Reddy Bandaru

unread,
Mar 22, 2013, 3:56:54 AM3/22/13
to mercu...@googlegroups.com
Hi,
We can even do this scenario with Child Item, below is the code

strRwcnt=Browser("name:= Inbox.*").Page("title:= Inbox.*").webtable("name:=Inbox.*").Rowcount
For i=1 to strRwcnt
  StrClmcnt=Browser("name:= Inbox.*").Page("title:= Inbox.*").webtable("name:=   Inbox.*").ColumnCount(i)
For j=1 to StrClmcnt
strdata= Browser("name:= Inbox.*").Page("title:= Inbox.*").webtable("name:=   Inbox.*").Getcelldata(i,j)
If Ucase(strdaata) = Ucase("Select") Then 
   Set Childitem=Browser("name:= Inbox.*").Page("title:= Inbox.*").webtable("name:=   Inbox.*").ChildItem(i,j,"WebLink",0)
   Childitem.Set "ON"
   Exit For
  Value=1
End If
Next
If Value=1 Then
Exit For
End If
Next

Please let me know if you have any concerns on this

Thanks & Regards,
Venkat Reddy Bandaru



On Fri, Mar 22, 2013 at 1:19 PM, Venkat Reddy Bandaru <vband...@gmail.com> wrote:
Hi,
This above scenario we have handle with DP( Descriptive Programming), below is the code
We have to pass which Checkbox you want to click and compare with the expected and then select it using DP

Set ODesc= Description.Create
ODesc("miccalss").value="Weblink"
ODesc("htmltag").value="A"
Set Childitem=Browser("name:= Inbox.*").Page("title:= Inbox.*").webtable("name:=Inbox.*").ChildObjects(ODesc)
For i=0 to Childitem.Count-1
 ChildName=Childitem(i).GetRoProperty("name")
 If Ucase(ChildName)=Ucase("Select") Then
   Childitem(i).Set "ON"
   Exit For
 End If
Next
Set ODesc =Nothing

Please let me know if you have any concerns on this

Thanks & Regards,
Venkat Reddy Bandaru

Venkat Reddy Bandaru

unread,
Mar 22, 2013, 3:49:35 AM3/22/13
to mercu...@googlegroups.com

Nani

unread,
Mar 23, 2013, 8:50:50 PM3/23/13
to mercu...@googlegroups.com
Gaurav,

I Just want to select a check box in Inbox of gmail

Regards,
Thrinath

gaurav sharma

unread,
Mar 23, 2013, 11:46:58 PM3/23/13
to mercu...@googlegroups.com
Hi Nani,

To select a chk box use below code:-

B().P().W().Set "ON"

Regards,
Gaurav

qtptest applications

unread,
Apr 1, 2013, 4:38:03 PM4/1/13
to mercu...@googlegroups.com
Hello Nani,

Let me know if you are able to identify the webtable correctly. You can use rowcount or getCellData. Then verify that the checkbox is in the right row column. This should help you

Thanks,
QtpTestApplication

PRASANTA BEHERA

unread,
Nov 15, 2013, 11:34:53 AM11/15/13
to mercu...@googlegroups.com
Hi Guys!!!!!!!!!!!!
 
Its very simple method using GetRowWithCellText method.
 
Ex:  Dim RowNo
       RowNo =  Browser().Page().WebTable().GetRowWithCellText("<text to pass from datatable>")
       Browser().Page().WebTable().ChildItems(RowNo, Column<Pass from Datatable or Itretate it), WebCheckBox, index<default 0>)
 
Kudos to Prasant!!!!!!!!!!!!!!!!!! :)

PRASANTA BEHERA

unread,
Nov 15, 2013, 11:35:10 AM11/15/13
to mercu...@googlegroups.com
Ex:  Dim RowNo
       RowNo =  Browser().Page().WebTable().GetRowWithCellText("<text to pass from datatable>")
       Browser().Page().WebTable().ChildItems(RowNo, Column<Pass from Datatable or Itretate it), WebCheckBox, index<default 0>)
 
Kudos to Prasant!!!!!!!!!!!!!!!!!! :)

PRASANTA BEHERA

unread,
Nov 15, 2013, 11:35:21 AM11/15/13
to mercu...@googlegroups.com, nani.t...@gmail.com
Reply all
Reply to author
Forward
0 new messages