how to click the link in webpage by using QTP Script????????

Answers were Sorted based on User's Feedback



how to click the link in webpage by using QTP Script????????..

Answer / maheshbabu.t

Hi this Mahesh I am sending answer for Above Question

step-1

U can write normal script below

Broser(B.Name).Page(P.Name).Link(L.Name).Click
Step-2
If u write function :

Public Function ClickLink(B.Name,P.Name,L.Name)

If Browser(B.Name).Page(P.Name).Link(L.Name).Exist Then
Browser(B.Name).Page(P.Name).Link(L.Name).Click

End If
End Function

Then u Call Function


Step -3

Descriptive Programe

Function linkClick(linkName,linkIndexVal)
ClearDialogs()

strHandle = Window
("RegExpWndClass:=IEFrame","index:=0" ).GetROProperty
("hWnd")
Set gobjBrowser = Browser("hWnd:=" & strHandle)

Set gobjPage = gobjBrowser.Page("index:=1")
gobjPage.Sync
Set objDescription = Description.Create()

objDescription("Class Name").Value = "Link"
objDescription("html tag").Value = "A"
objDescription("name").Value = linkName

If gobjPage.Link(objDescription).Exist(0) Then
gobjPage.Link(objDescription).Click
else
objDescription("index").value=linkIndexVal

If gobjPage.Link(objDescription).Exist(0)
Then
gobjPage.Link(objDescription).Click
else
Print linkName&" Link not Exist"

End if
End If

End Function

Is This Answer Correct ?    6 Yes 0 No

how to click the link in webpage by using QTP Script????????..

Answer / gayathri

Browser().page().Link().Click

Is This Answer Correct ?    7 Yes 9 No

how to click the link in webpage by using QTP Script????????..

Answer / gayathri

Hi,

Browser().Page().WebLink().Click

Is This Answer Correct ?    3 Yes 11 No

Post New Answer

More QTP Interview Questions

What is the exact difference between QTP and RFT ?

2 Answers   CTS,


How you can write contexts to text file in qtp?

0 Answers  


Can we directly automate testscripts accrdoing to requirements? WHY ?

1 Answers  


what are the cases in which we use XML and accessibility check points.

2 Answers  


How can we disable smart identification at the time of recording? Ideally, smart identification should be enabled only at the run-time.

3 Answers  


How many types of recording modes in qtp? Describe each type with an example where we use them?

0 Answers  


Explain about reusable actions?

3 Answers   IBM,


how do u manipulating INI, DLL and / or registry files in support of your test environment? actually what do u mean by INI and DLL or registry files. plzzz its urgent do answer

0 Answers  


tell me QTP standards ?plz

0 Answers   Kanbay,


When a requirement is given to u to automate , What is ur basic approach ?

4 Answers  


When ‘option explicit’ keyword is used in qtp?

0 Answers  


How do you delete unwanted results in qtp?

0 Answers  


Categories