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

hi guys, could you please prepare script for given format ? 1,1,2,3,5,8,13,21,...etc use vbscript for this...?

2 Answers   Value Labs,


How did you use regular expressions in QTP and also in WR?

0 Answers  


How we test web based application by using QTP

0 Answers  


1. How can we use same object repository and Testscript which is in English flavor to check the application in different languages thru QTP?(Chinese,Dutch,French) - I generated script in english and want to use the same script with different languages? - for windows i used regular expressions - I need for edit box,button and combobox, (English,French,Dutch,Chinese) These are the properties of a button in different languages Properties English Dutuch Chinese French x 400 758 631 601 y 673 603 592 676 windowstyle 1342242816 1342242816 1342242816 1.34E+09 windowid 2 2 2 2 windowextended style 4 4 4 4 width 120 120 120 120 visible TRUE TRUE TRUE TRUE righttoleft reading FALSE FALSE FALSE FALSE righttoleftlayout FALSE FALSE FALSE FALSE rightaligned FALSE FALSE FALSE FALSE regexpwndtitle cancel Loschen Chinese language Annuler regexpwndclass button button button button objectclass button button button button hwnd 132872 657228 656932 656782 height 33 33 33 33 focused FALSE FALSE FALSE FALSE enabled TRUE TRUE TRUE TRUE attached text abs_y 669 599 627 597 abs_x 396 754 588 672 text cancel Loschen Chinese language Annuler nativeclass button Button ordinal Identifier type,Value none none none none smartidentification FALSE FALSE FALSE FALSE comment

1 Answers   TCS,


In your QTP framework, what checkpoints were applied in the script to minimize script failure due to any reason during execution?

1 Answers   ITC Infotech,






what is action in QTP?

1 Answers   Infosys,


What are the differences between quicktest professional and winrunner?

0 Answers  


Maximum synchronizing time out in QTP

3 Answers   Kanbay,


1. What is the difference between Keyword and function in the keyword driven framework? 2. How do you associate Keywords to the script ?

0 Answers  


What are advantages of test automation?

0 Answers  


what are the Tools for version control?

3 Answers  


What are the drawbacks of QTP?

10 Answers   Ordain Solutions,


Categories