how to get the object count ?????????

Answers were Sorted based on User's Feedback



how to get the object count ?????????..

Answer / prasad.dasagrandhi

iam using QTP 9.2

in a cal appli i have add,sub,mul,div buttons to get the
count i have written this script

but it is showing count is o, can anybody help me


systemutil.Run"C:\Users\Raju\Desktop\cal.exe"
Set desc =Description.Create()
desc("micclass").Value = "Button"
set button=vbwindow("vbname:=CALCULATOR").vbbutton
("vbname:=ADD").ChildObjects(desc)
a= button.count
msgbox (a)

Is This Answer Correct ?    3 Yes 1 No

how to get the object count ?????????..

Answer / pvr

systemutil.Run"C:\Users\Raju\Desktop\cal.exe"
Set desc =Description.Create()
desc("micclass").Value = "Button"
set button=vbwindow("vbname:=CALCULATOR").vbbutton
("vbname:=ADD").ChildObjects(desc)
a= button.count()
msgbox (a)

Is This Answer Correct ?    1 Yes 0 No

how to get the object count ?????????..

Answer / prakash pandey

set desc=description.create
desc("micclass").value="WinEdit"
set
childobject=browser("google").page("google").childobjects(desc)
msgbox childobject.count

Is This Answer Correct ?    2 Yes 1 No

how to get the object count ?????????..

Answer / karthik

Option explicit
Dim childs, n, odesc
systemutil.Run "C:\WINDOWS\system32\calc.exe"
Set odesc=description.Create
odesc("micclass").value="WinButton"
set childs= Window("text:=Calculator").childobjects(odesc)
n=childs.count
print "number of buttons is "&n
Window("text:=Calculator").Close


The above script perfectly gives you with the answer. Just
copy and Paste it in your QTP and run it. NO modifications
required

Is This Answer Correct ?    1 Yes 0 No

how to get the object count ?????????..

Answer / barani

systemutil.Run"C:\Users\Raju\Desktop\cal.exe"
Set ODesc = Description.Create
ODesc("micclass").value = "Winbutton"
set ChldODesc = Window
("regexpwndtitle:=Calculator").ChildObjects(ODesc)
print ChldODesc.count

Is This Answer Correct ?    1 Yes 0 No

how to get the object count ?????????..

Answer / arjuncr

dear raju it is wrong

systemutil.Run"C:\Users\Raju\Desktop\cal.exe"
Set desc =Description.Create()
desc("micclass").Value = "Button"
set button=vbwindow("vbname:=CALCULATOR").vbbutton
("vbname:=ADD").ChildObjects(desc)
a= button.count
msgbox (a)

this one is correct
systemutil.Run"C:\Users\Raju\Desktop\cal.exe"
Set desc =Description.Create
desc("class Name").Value = "Button"
set button=window("regexpwndtitle:=CALCULATOR").ChildObjects
(desc)

msgbox desc.count

Is This Answer Correct ?    1 Yes 0 No

how to get the object count ?????????..

Answer / nagk24

cnt=0
Set d=description.Create
d("micclass").value="WinEdit"
Set a=window("text:=Flight Reservation").ChildObjects(d)
For i=0 to a.count-1
cnt=cnt+1

Next
msgbox cnt

Is This Answer Correct ?    1 Yes 1 No

how to get the object count ?????????..

Answer / reddy prasad

NAGK24

Pvr

iam not getting the count

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

Can the mode of object repository be change during run time? Eg. if the mode is per-action during design time can i change it to shared and vice-versa? Any scripting possible?

2 Answers  


I am a newbie to QTP / Automation testing. I want to develop a script that creates a data file automatically with proper headings using VBScript in QTP.

0 Answers   Adea Solutions,


When to use descriptive programming?

0 Answers  


Where u will use output checkpoint in QTP?

3 Answers   HCL,


How to findout the number of spaces with in STRING For Ex : STRING is " RAJ IS A SOFTWARE ENGINEER " Please send me the answer

3 Answers  


WHAT IS ENVIRONMENT VARIABLES?

7 Answers   AZTEC, CTS, Ready Test Go,


Using Regular expression in Date format DD/MM/YYYY (0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[12])/([0-9]{4}) in this regular expression year 0000 also accepted.I need atleast any one single digit must be nonzero value (like 0009,1000,0034)

1 Answers  


why don’t use real time they r not using check points

1 Answers   Wipro,


what is the difference between xmlutil and xmlDOM in qtp?

2 Answers  


What is the difference between rational rose and QTP?

0 Answers  


what is object?

5 Answers   iFlex,


Hi, I am new to QTP and vb.script.How to start to write vb.script in QTP? Please give me suggestions?

3 Answers  


Categories