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
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 |
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 |
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 |
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 |
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 |
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 |
Explain about Standard output value, Text output value, database o/p value, Xml O/p value, Xm o/p Value
IF I SET THE VIRTUAL OBJECT AFTER THAT MAXIMIZE THE APPLICATION THEN QTP SENT ERROR OR EXECUTE SUCCESSFULLY? WHY ?
In QTP, What is Global action and Local action?
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?
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.
Hi All , How can we decicde for pariticular frame(DataDriven or Keword Driven)in Project? Thanks Balaji
Explain advantages and disadvantages kdf?
Hi, i have a string like "INDIA". I need to display this string vertically in Msgbox?
what is TOM in qtp?
Hi frnds, does anybody know if there is anything called "thin point" or something in qtp? thanks in advance.
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
what is the difference btn risks & Therads in the Test plan documentation?