Write a QTP script to print all the link names displayed in
a web page

Answers were Sorted based on User's Feedback



Write a QTP script to print all the link names displayed in a web page..

Answer / xyz

set linkObj=description.create
linkObj("micclass")="link"

set linkChildObj=B().p().childobjects(linkObj)
childCount=linkChildObj.count

for i=0 to childCount-1
linkName=linkChildObj(i).getROProperty("innertext")
msgbox linkName
next

Is This Answer Correct ?    51 Yes 10 No

Write a QTP script to print all the link names displayed in a web page..

Answer / siba

set linkObj=description.create()
linkObj("micclass").value="link"

set linkChildObj=Browser("Google Accounts").page("Google
Accounts").childobjects(linkObj)
childCount=linkChildObj.count
msgbox(childCount)
for i=0 to childCount-1
linkName=linkChildObj(i).getROProperty("innertext")
print( linkName)
next

Is This Answer Correct ?    16 Yes 2 No

Write a QTP script to print all the link names displayed in a web page..

Answer / mani

go to any web page click on any link..store it in OR
manager...Then according to the browser name and page name
write the script
Example:


Browser("name").Page("name").weblink
("destination").GetROproperty("number of links")

Is This Answer Correct ?    11 Yes 16 No

Write a QTP script to print all the link names displayed in a web page..

Answer / bidyut prava

Browser("name").Page("name").Link("destination").Click

Is This Answer Correct ?    4 Yes 11 No

Post New Answer

More QTP Interview Questions

How to Install QTP on Citrix Environment? Possible send me the installation steps.. That would be great help

1 Answers  


In how many ways we can add check points to an application using QTP.

4 Answers  


what is tool interface?

1 Answers   ITC Infotech,


VB - Script Training in MUMBAI.

1 Answers  


Discuss quicktest professional (qtp) environment?

0 Answers  






what will be the stmt if record any edit box in the Web application ?

2 Answers   eSymbiosis,


Hi Friends, How to trap an error message on Web page through QTP. Example:- When I put wrong user id or Password on a web page, I get the error message. So when I add the error object in Reposatory, every time it shows as Login Failed Object exist, eventhough using corret login details. And if I do the same without adding the object it shows as object not found. This might be because while recording QTP takes every new page as _1 _2 _3 and so on. as below. Browser("XXXXX").Page("XXXXX_1"). >>login Browser("XXXXX").Page("XXXXX_2"). >>Inbox Browser("XXXXX").Page("XXXXX_3"). >>Sent Items I used below code. Browser("XXXXX").Page("XXXXX").WebEdit("firstname").Set strFN Browser("XXXXX").Page("XXXXX").WebEdit("lastname").Set strLN Browser("XXXXX").Page("XXXXX").WebEdit("userid").Set strUserID Browser("XXXXX").Page("XXXXX").WebEdit("password").Set strPass Browser("XXXXX").Page("XXXXX").WebButton("Login >").Click If Browser("XXXXX").Page("XXXXX_2").Image ("msg_icon_error").Exist 5 Then Reporter.ReportEvent micFail, "XXXXX", "Login Failed!" ExitRun (It shows login failed ever after login is passed. Else Reporter.ReportEvent micPass, "XXXXX", "Login Successful!" End If Please find out a way for me here, and provide me with the correct code. Thanks in Advance.

1 Answers  


How do you find out whether the string is Numeric or Alpha numenric.Suppose..'QTP is an automation testing tool 12345' How should I know it is alphanumeric.Can any one please write the code for this

4 Answers  


What is the basic concept of quicktest professional?

0 Answers  


How many types of parameters are there?

0 Answers  


I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?

0 Answers  


In Test Directory, What are the contents in test case designing? if you prepare in excel sheet how u use thrw Test Directory?

0 Answers  


Categories