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



How Exactly we can find out the INDEX No. of any object of an application when we test that applica..

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

How Exactly we can find out the INDEX No. of any object of an application when we test that applica..

Answer / shashank

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

How Exactly we can find out the INDEX No. of any object of an application when we test that applica..

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

How Exactly we can find out the INDEX No. of any object of an application when we test that applica..

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

Post New Answer

More QTP Interview Questions

what is Automation frame work and how do u used this for your project?

3 Answers  


What is the difference between Call to Action and Copy Action.?

2 Answers  


vb script for calling one function to the another function

2 Answers  


1.what is test automation life cycle?

1 Answers   IBM,


Explain getroproperty and gettoproperty & settoproperty?

1 Answers  






Hi! My OTP script has several bitmap checkpoints included which I check in the test results xml file. The test is for SAP 4.7. I need to save these bitmaps to files or at least export them to the html file using the export function in the test results viewer. Could you please help me with this problem? Thank you in advance! Best regards, Peter

0 Answers   TCS,


what is the test process followed for your project?

1 Answers   ADP, Satyam,


Explain about the Test Fusion Report of QTP?

1 Answers   Crea,


How we can merge the object repositories?say if we have 2 or 3 object repositories then how we can merge them?Is there any option in QTP to merge the object repositories?

2 Answers  


will QTP 9.2 run successfully on Linux(gui) operating system

1 Answers  


How to test whether the navigation i.e. from one page to another is working r not using QTP for web based application

1 Answers  


1.In VB Script 100 lines Script. How can check the Syntax errors? 2. Write a VB Script for X = India/Srilanka/Australia/England/South Africa.I need the Output Country wise? [ 1st Msgbox India , 2nd Msgbox Srilanka] ---- 3. How can Choose these test cases to be automated?

5 Answers   HP,


Categories