How to get all the objects count and objects names in
webpage using QTP ?
Answers were Sorted based on User's Feedback
Answer / devi
Set b=description.Create
b("micclass").value="Browser"
Set obj=desktop.ChildObjects(b)
msgbox obj.count
'browser("CreationTime:=4").close
For i=0 to obj.count-1
msgbox i
c=obj(i).getroproperty("name")
msgbox c
Next
| Is This Answer Correct ? | 9 Yes | 4 No |
Answer / sai
Dim a(100)
set p=Browser("Home").Page("Home").ChildObjects
cnt=0
For i=0 to p.count-1
b=p(i).GetTOProperty("micclass")
If i<1 Then
a(0)=b
Else
For j=0 to Ubound(a)-1
If a(j)<>b Then
cnt=cnt+1
a(cnt)=b
End If
Next
End If
Next
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / chandu
Hi kumar...
thanx for ur response man..
r u working on QTP..if yes can i hav ur email id..so that
if i get any doubts i'll get in touch with u..
Thanks in Advance
Chandu
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / chandu
u can count the objects in a webpage by using childobjects
method
set childobjs=Browser("BrowserName").Page
("PageName").childobjects
total=childobjs.count
msgbox total
n i don't know how to get the names...sorry..if u know
plese let me know
| Is This Answer Correct ? | 0 Yes | 4 No |
Answer / chivukula.kumar
Hi Chandu,
ChilObjs=Browser("BrowserName").Page
("PageTitle").Childobjects
tol=Chilobj.count
for i = 0 to UBound(tol)
a =chilObjs(i).Name
print a
Next
| Is This Answer Correct ? | 3 Yes | 23 No |
Hi, i run scripts in one machine those r passed.when i run the scripts in client side those r failed.Give me such a scenario when ever u faced?
If requirments changed then how we can teach the QTP this is the new requirment
Explain the difference between check point and output value?
I came across Good question ..... Write a script to only download pdf's if there are 20 links on a page. Kindly reply these type of questions are pretty challenging..
During test run,How will you copy/paste from/to clipboard?
what is the hierachy of Descreptive programming?
how we connect oracle or sql data server database to qtp.
An action has both shared and local OR associated with it and both have the same object in them. In the test which one will be considered?
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.
Does QTP run in any environment?
Diff b/w test scenario's and test Procedures?
how to check URL using QTP? write vb script with descriptive programm only?