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 are the enhancements u did after recording ur script?
If we write a script in the expert view how are the objects created in the object repository? to be clear i will explain my problem first i have recorded the mercurytours application by providing the link www.mercurytours.com and all the objects are stored in the object repository ok this is fine. but i have copied the script generated in the above processes and pasted in a new test and tried to run that script but as the objects were not stored in the object repository it showed an error (The "Welcome: Mercury Tours" object was not found in the Object Repository. Check the Object Repository to confirm that the object exists or to find the correct name for the object).so how can i overcome that error
How do we connect QC by using QTP?
why we are using environment variables instead of global variables?
What are the advantages of Object Repository?
can u give one scenario for for PopWindow Exception & write Code for that?
How do you data drive an external spreadsheet?
How Does Run time data (Parameterization) is handled in QTP?
what is descriptive programming?
what are the challenges you have faced while testing web based application using the automation tools ?
How to run a test using quicktest professional (qtp)?
How can you identify the browser and its information using QTP script?