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

Can Any One Write How to Write the Script for Child Objects

4 Answers  


An object is created, i dont know the methods available for that object, i want to find methods available for that object and use the required method. How i can do this???

4 Answers   HCL,


what properties do use to identify a browser and page while using descriptive programming?

3 Answers   TCS,


a title of first page is "LKO- microsoft internet explorer", of the second page is "PPM- microsoft internet explorer" , of Third page is "TTS- microsoft internet explorer" and same changing title on the fourth page. How can we use regular expression for this feature what should we do on script part on and Object repository part so that we can get successful run result. Kindly explain the steps script.

2 Answers  


write vbscript on veb applications in qtp with exapmles?

1 Answers  






I have the script like this: Browser("Login").Page ("Application").Frame("ScopeFrame").Link("DC3701737 (Active)").Click in which the value "DC3701737" will get changed and i have to use the same value in so many places. I got the value "DC3701737" in to a variable(Say x). Now if i want to pass the variable in to link object .. how? Browser("Login").Page("Application").Frame ("ScopeFrame").Link(x).Click Is it possible to pass any variable into a link object .. so, that the application will select that link automatically? If ur not able to understand, pls let me know.

2 Answers   ABC,


What is a Dictionary object in QTP.?

1 Answers   Cap Gemini,


how would you go for testing a web application like any jobsite?(using manual n qtp)..pls frnds its very urgent ..i need realtime answers...thanks in advance

2 Answers   Wipro,


What is an Regular expression doing in VBScript?Tell the pattern for the email verification.

0 Answers   Accenture,


Hi All, I am 4 yrs experieced in manual testing and new to automation tool QTP. Iam trying to learn it thru online and material i have.I am able to understand but unable to trace out which method or function to be used where necessary in VB Script. How come we know the functions or methods to be used to open a window when clicking on button or so...Pls suggest me.How can i proceed further to apt VB Script.

0 Answers  


If our application contain one image while executing script application failed to show that image but you have to check that image by importing dynamically from other location... Can we use Check Points here on dynamically imported image?

2 Answers   ADP,


how can i call reusable action in a function could any one explain me?

2 Answers   Livetek,


Categories