How Exactly we can find out the INDEX No. of any object of
an application when we test that application in QTP? Explain
this by giving me the example of all LINKS of G-Mail
(including home page, User-account page and all possible
pages you ever seen in G Mail)?????? and if your answer is
that as per appearance of objects(LINKS) in application we
can find out the index number in application then tell me
how you find out which object(LINK) having INDEX No. 1,2,3
and so on and how you say which object(LINK) is appeared
first and which is last?
Answers were Sorted based on User's Feedback
Answer / udham
Hi
I also faced the same question .i tried hard 2 find the solution but didn't get anywhere .i tried many times with QTP.
This is the solution which i get.
this will tell u the index no. at execution time.
This is not the exact answer .this is called programming jugad.
set c = description.create
c("micclass").value = "Link"//i m using link only .u can use any other object type also.
set obj = b().p().childobjects(c)
msgbox obj.count //will give the count of all links on page
for i = 0 to objcount-1
b().p().link("index:="&i).highlight//this will highlight the link with index no 0 in the application as initiallly the value of i is 0.
msgbox i //printing the value of index
next
| Is This Answer Correct ? | 8 Yes | 2 No |
Hey Buddy!!!!!!!!!!!!!!
i want to know the possible method to find out how index no.
is recognize by qtp as per appearance of object in
application and you just explain to declare a object there
property and method with the help of descriptive
programming............
that's not my question........
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / pravesh
Set br=description.Create
br("micclass").value="Browser"
br("title").value="Welcome:.*"
Set pg=description.Create
pg("micclass").value="Page"
pg("title").value="Welcome:.*"
Set obj=description.Create
obj("micclass").value="Link"
Set objv=Browser(br).Page(pg).ChildObjects(obj)
cnt=objv.count
msgbox cnt
For i=0 to cnt-1
msgbox Browser(br).Page(pg).Link("Index:="&i).GetROProperty("name")
print "Index:="&i
print Browser(br).Page(pg).Link("Index:="&i).GetROProperty("name")
Next
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / ira
Set oLinks = Description.create
oLinks("html tag").value="A"
oLinks("visible").value=True
oLinks("outerhtml").value= "<A class=l.*"
set tLinks = Nothing:
set tLinks = Browser("name:=.*Google.*").Page
("title:=.*Google Search").ChildObjects(oLinks)
a= tLinks.count
For i=0 to tLinks.count-1
strUrl ="" : strUrl = tlinks(i).GetROProperty("innertext")
Next
| Is This Answer Correct ? | 1 Yes | 10 No |
what is QTP batch testing tool?
What are the key elements available in test result window?
Hi am New to Automation Testing , any one can you help me what are the basic questiion are asked an interview?
How do you return a value from a function
Where should i find checkpoint and virtual objects's Object properties and values in the QTP 9.2 Means where checkpoints or virtual objects related data will store If i want to get the runtime object properties how can i use Getroproperties on Checkpoints
How many types of Recordings are there in QTP and what are they?
7 Answers Dangote, First Indian Corporation,
While scripting do we use any reference. may be we have 2 0r more same objects that time how do we write scripts
Syntax for how to call one script from another and Syntax to call one "Action" in another?
How to record object in runtime. I am testing one Image website in which every time image change on home page.so if i records the image list but during running image get change, and QTP gives error
What is qtpro? What is a quick test professional?
Explain in brief about the quicktest professional automation object model?
Please mail me the license key of QTP 9.5 t v.sadangi@gmail.com ????? thx