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 description object?

0 Answers  


I wanted to create Data Driven test for login page (loginname,password). Password is same for all the loginnames. I recorded the script for one user. I mentioned all the user names in the global excel sheet with the column name as "Loginname". I mentioned 5 loginnames. I selected tools- >datadriver and select loginname. Select parameterize and select parameter all option.Changed the parameter name to "loginname" which i mentioned in the global excel sheet. I executed the script. For the users 2 and 4 only, the script is failing... can anybody explain why the script is failing for users 2 and 4.

2 Answers  


what is On Error Resume Next ?

1 Answers   Accenture,


How to change the Default synchronization method time and where?

4 Answers  


Explain roles and responsibilites of 2yrs Automation qtp engineer.

3 Answers   Oracle,


how can we compare descriptive programing with a regular expression

0 Answers  


How are actions and functions different in QTP?

0 Answers  


distinguish between old version and new version QTP features.

0 Answers   CTA,


how we connect oracle or sql data server database to qtp.

4 Answers   TCS,


What are the file extensions for per-action, shared object repository files and what is the extension for library files?

9 Answers   Semantic Space,


Suggest and Define a solution for an application whose objects are not recognized by UFT?

0 Answers  


1. I have asked the same question for the third time, but i am getting wrong answers. Pls give me the script to count the number of edit boxes or checkboxes in an windows application screen. In windows application childobject is not working, anyone very urgent

8 Answers  


Categories