How will u find that how many List boxes( and check boxes)
are present in one particular window

Answers were Sorted based on User's Feedback



How will u find that how many List boxes( and check boxes) are present in one particular window..

Answer / nanda

Hi,

try this code...


set odesc = discription.create

odesc("Class Name").value ="WinCheckBox"
odesc("native class").value="Button"

set checkboxcount= window("<window name>").childobjects
(odesc)

counts=checkboxcount.count

msgbox counts

u will get number in msgbox.

please ping me if there is any feedback.

Is This Answer Correct ?    5 Yes 0 No

How will u find that how many List boxes( and check boxes) are present in one particular window..

Answer / nanda

Hi,

try this code... i did some spelling mistake in above
answer..pls change that..

discription=description

Is This Answer Correct ?    5 Yes 0 No

How will u find that how many List boxes( and check boxes) are present in one particular window..

Answer / nanda

Hi,
then do some modification..

Just remove line Odesc("nativeclass") = "Button"

I think it will work now

If any queries..

nanda.dreddy@gmail.com

Is This Answer Correct ?    2 Yes 0 No

How will u find that how many List boxes( and check boxes) are present in one particular window..

Answer / akila

hi,
i tried this script. it's working fine but not giving
appropriate checkbox in the application

Is This Answer Correct ?    1 Yes 0 No

How will u find that how many List boxes( and check boxes) are present in one particular window..

Answer / kalyan

HI Every bodey,---

Any object present in the page is known as childobject.
Ex:-Link,Web Edit,Check Box,Web button,List box,etc...

If u want to coun the Listboxes (or)Check boxes you can
write below script.

---------CODE----------

set ochbox=description.create
ochbox("micclass").value="checkbox"

set chobj=Browser().Page().childobjects(ochbox)
n=chobj.count

msgbox n '(here you can get how many check boxes there in a
page)

for i=o to n-1
val1=chobj(i).getroproperty("innertext","name")
msgbox val1
next
-----------End---------
In the same way we can find Links,Webbuttons,Listboxes,etc..

Any doubts----mail to----mskalyan.smile@gmail.com

Is This Answer Correct ?    1 Yes 0 No

How will u find that how many List boxes( and check boxes) are present in one particular window..

Answer / venkatesh

Set oPageObject = Browser("browsername").Page
("pagename").Object
Set oTableObject = oPageObject.getElementsByTagName
("list")
iTotalTbl = oTableObject.length

Is This Answer Correct ?    0 Yes 0 No

How will u find that how many List boxes( and check boxes) are present in one particular window..

Answer / ramya

'Counting total number of lists

Set Odesc= Description.Create
Odesc("htmltag").value= Input
Set linkcollection= Browser("").page("").childobjects(Odesc)
Itemcount=linkcollection.count()
msgbox Itemcount

Is This Answer Correct ?    0 Yes 0 No

How will u find that how many List boxes( and check boxes) are present in one particular window..

Answer / softwaretester4u

very intresting question,but i never found in QTP my
experience .pls tell me if any one knows

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More QTP Interview Questions

What will be happen if i load object repository at run time, but it has already associated.

0 Answers   NTT Data,


I am getting the "test object property" Description properties "toolkit class" value By using "gettoproperty" in run time But my problem is how to get Ordinal Identyfier's type and value Type is index, value is 0 How can i keep this values in to required place How can i get these values in runtime I have to insert these "index" and "value" into another area Is there any script for this like "gettoproperties","Getroproperties" If anybody knows,please help me .

0 Answers   Livetek,


Describe function procedure in vbscript.

0 Answers  


How Can I automate PDF forms using QTP9.2 ?

0 Answers  


w is time parameter

1 Answers   Syntel,






How to get the particular property value?

0 Answers  


using descriptive programming how to close all opend browsers?

7 Answers   Satyam,


what are the challenges do we face while testing webbased applcations using the automation tool QTP or any?

4 Answers   BirlaSoft,


requirement is for combo box your expected value is str= "Denver.Frankfurt.London.Los Angeles.Paris.Portland.San Francisco.Seattle.Sydney.Zurich" ar = Window("Flight Reservation").WinComboBox("Fly From:").GetContent your actual value is : that shows data in combo box how can u test the both data is correct or not by using split function

1 Answers   FIS,


what is the frame work your using in automation ?

4 Answers  


1.what is test automation life cycle?

1 Answers   IBM,


How to find array size in qtp?

0 Answers  


Categories