how to click the link in webpage by using QTP Script????????
Answer Posted / 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 |
Post New Answer View All Answers
can any body plz help by sending the qtp docs and qtp ppt's? this is my mail id:murali.padeti@gmail.com
Please help me by providing the License key for QTP 9.2, at guru_aarya@yahoo.co.in Best Regards Gururaj.B
What is the use of defining a newobject in the object repository "Define New TestOject". How to use this further. If we define new testobject, how can it recognizes the objects properties of any application.
in qtp if we record a object and we record the object using virtual wizard then by which way the object is recognized that means recorded
PLEASE TELL ME WHEN DO YOU USE THE OBJECT SPY AT RUN TIME
how to create flat file datasubmission in qtp
What is the pros and cons between QTP and Rational Robot
I am trying to install QTP 9.5 but i am getting error message saying that ("Path is \QuickTest Professional\bin\vb_init.exe") vb_init.exe file is not find. can anybody give me the advise what to do ?
Why qtp the best testing tool?
How does quicktest professional identifies the object in the application?
What are the methods of the TextStream object that are used for reading from a text file?
what is error and fault in terms of software quality?
What is the difference between run time object and test object?
With what extension you can save the list of tests in a file to run in test batch runner?
On the website, the protocol has been changed https: to https what you will do? Tell me your approach?