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

Please guide me release notes of Automation once scripts are completed

0 Answers  


Add parameters during time in each row in one column

0 Answers  


What is the difference between the keyword view and expert view?

0 Answers  


Do you support automated testing? Why?

0 Answers  


how could i download qtp in which i get add-in support for 'oracle' is there any way to get it? i finding but not getting pls help me out :)

0 Answers  


How to manage a drag drop event in the qtp

3 Answers  


how to connect qtp to sqlserver?(if any body know about this please send mail to me:sheik_feroz5@yahoo.com)thank u

3 Answers   Honeywell,


what is option explicit? what is the use of it?

9 Answers   Syntel,


Have you performed Debugging and how did you?

2 Answers  


how to insert QTP to display errors and other description in the test results instead of halting execution by throwing error in the mid of executin due to an error (for object not found)?

1 Answers   Ordain Solutions,


Hi I know two types of testing processes. 1. Reaquirments stage,test design,code review's, Design review's, Test Plan, Test Cases design, test execution, Defect Reporting and tracking, UAT, Signoff. 2.Test Initiation , Test Plan, Test Design, Execution,Bug tracking, UAT, Sign off.

0 Answers  


diff between global variables and environment variables in qtp?

1 Answers   FIS,


Categories