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

How many tabs are available to view your test in a test pane and what are they?

0 Answers  


Hi, Has anybody attended IBM interview on 17th APR 2010,and got offer letter? I had given interview and selected also but still did not recieve offer letter.

5 Answers   IBM,


what is the qtp objects?

0 Answers  


hi frinds i need help .i have 4 + yrs exp in testing and nearly 2 yrs exp in QTP and QC .currently iam working north fast 2 yrs iam looking for job in south is there any openings plz letme know my mail id is pbre1980@gmail.com

0 Answers  


How to recognize and read data from pdf file using Descriptive Programming in QTP?

1 Answers   Satyam,






what is verification & validation?

2 Answers   Accenture, TCS,


what is Property......End Property loop? how to write sript for it in QTP

0 Answers  


How to find operating system information using the qtp script?

0 Answers  


suppose i have one datatable in my datatable in 2 nd row 3rd column one link is ther i need to validate that link how do u do this?(wipro)

4 Answers   Fidelity, Wipro,


How can you quit from Action.

2 Answers  


Is there anyway to have QTP go into a website and map out every object before I actually record any tests? I basically want to map out a website with all the objects and build a complete repository. The reason is because I'm running into issues with hierarcical objects. for example: Browser("ABC company- Home").Page("ABC company - Home").Link ("About Us").Click Browser("ABC company - Page 2").Page("ABC company - Page 2").Link("About Us").Click Both these links ("objects" and I use that term loosely as I'm trained mostly in OO programming) go to the same place but but the object heirarchies (pages) are different. I want a repository that will find any possible link on any possible page without having to manually record it. Is there a way to do this?

1 Answers  


How to get the run time object property without using GetROProperty

4 Answers  


Categories