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 give the banking domain concepts/links
What is object spy in quicktest professional (qtp)?
If we put all properties in mandatory and assistive list of Normal Identification, Do we still need Smart?
how could i download qtp in which i get add-in support for 'oracle' is there any way to get it? i finding but not getting pls help me out :)
What is Unicode Compatibility?
How you are developing the script? Using record and play back or manual?
To which environments does quicktest professional (qtp) supports?
i am new QTP... please tell me automation frameworks , types & for whiich type of applications frameworks are used & how to generate script in keyword driven framework
How to upload excel files into Quality Center using QTP Script and how to delete excel files from Quality?
What is a quick test professional?
Client is able to provide budget..he want you to choose the automation tool for the web application? which one you will select ? QTP or Selenium ? what are the reasons?
Excel sheet having some datas and some datas present in the application (in table). How will you compare these two datas? Write code to fetch datas from Excel sheet.
Explain runtime dynamic settings?
RECENTLY I PLACED IN QTP..HOW TO IMPROVE VB SCRIPTS KNOWLEDGE? IAM STRUGGING TO WRITE THE AUTOMATION SCRIPTS? ANY BODY TELL HOW TO IMPROVE QTP SCRIPT SKILLS?
Problem with XML checkpoint in QTP ?