Write a user defined function to count the no. of buttons
existed in a webpage ? i dont want to use descriptive.create
()

Answers were Sorted based on User's Feedback



Write a user defined function to count the no. of buttons existed in a webpage ? i dont want to us..

Answer / pramod

1)Open Flight Reservation Login page
2)Add Login page in to the Object Repository
3)Write below code and run it

' Directly pass the login as argument to the function
childobj Dialog("Login")

' The function will take object as input argument and count
the child objects in the login page
Function childobj(CountObject)

aa=CountObject.ChildObjects.count
msgbox aa
End Function




Thanks
Pramod
pramod_login@yahoo.com
9845454652

Is This Answer Correct ?    2 Yes 0 No

Write a user defined function to count the no. of buttons existed in a webpage ? i dont want to us..

Answer / ram.polavarapu

function countedit()
dim e
e=0
n=browser("").page("").chaildobjects

if n="WebEdit" then
e=e+1
print e
next
end function

Is This Answer Correct ?    2 Yes 1 No

Write a user defined function to count the no. of buttons existed in a webpage ? i dont want to us..

Answer / geetha

Set list = browser("XYZ").Page("ABC").ChildObjects
countbutton (list) 'Pass the object to function

Function countbutton(allitems)
cnt = allitems.count
num=0
For i=0 to cnt-1
name1 =allitems(i).getroproperty("micClass")
If name1="WebButton" Then
print "position of web button is " &i
num = num+1
End If
Next

print "count of webbuttons present in a page are" &num
End Function

Is This Answer Correct ?    1 Yes 0 No

Write a user defined function to count the no. of buttons existed in a webpage ? i dont want to us..

Answer / krishna chand

Hi,

If u got answer to this question can u plz snd me 2 also.
I 2 got this same question in Kanbay

Is This Answer Correct ?    0 Yes 0 No

Write a user defined function to count the no. of buttons existed in a webpage ? i dont want to us..

Answer / suchitra k

hi
we are having one property in qtp child objects.it returns
collection of objects contained with in the object.

Is This Answer Correct ?    1 Yes 3 No

Write a user defined function to count the no. of buttons existed in a webpage ? i dont want to us..

Answer / pramod hitnalli

1)Open Flight Reservation Login page
2)Add Login page in to the Object Repository
3)Write below code and run it

ChildObj=Dialog("Login").ChildObjects.count
msgbox ChildObj


Thanks
Pramod
pramod_login@yahoo.com
9845454652

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More QTP Interview Questions

Explain about Standard output value, Text output value, database o/p value, Xml O/p value, Xm o/p Value

1 Answers   TCS,


IF I SET THE VIRTUAL OBJECT AFTER THAT MAXIMIZE THE APPLICATION THEN QTP SENT ERROR OR EXECUTE SUCCESSFULLY? WHY ?

2 Answers   CTC, Infosys,


In QTP, What is Global action and Local action?

0 Answers   Virtusa,


Can you tell me the differences between writing the VB script manually for a application and recording the same application in QTP , with a example?

1 Answers  


Hi Guys, In one of my interviews, I was asked to Write a paragaraph explaining how much scripting I did in QTP? I don't know where to start and what to write. So I need your help in writing that.

1 Answers  


Hi All , How can we decicde for pariticular frame(DataDriven or Keword Driven)in Project? Thanks Balaji

0 Answers  


Explain advantages and disadvantages kdf?

0 Answers  


Hi, i have a string like "INDIA". I need to display this string vertically in Msgbox?

3 Answers  


what is TOM in qtp?

5 Answers   Accenture,


Hi frnds, does anybody know if there is anything called "thin point" or something in qtp? thanks in advance.

1 Answers   scintel,


Suppose u run ur script today and it is working fine ,nobody has changed the setting and all.u r the owner for the script. But when tomorrow I ran the same script again it got failed and It didn't able to identify one object. Can you tell me what would be the reason for this

4 Answers   L&T,


what is the difference btn risks & Therads in the Test plan documentation?

0 Answers   Accenture,


Categories