write generic functions for webapplication?like
generic function for webedit
generic function for webbutton
generic function for links
Answer / manjunathareddy
Function AppTest(ObjectType,Objname,Testvalue)
Set oBrowser=Browser("name:=.*")
Set oPage=oBrowser.Page("title:=.*")
Select Case ObjectType
Case "WebEdit"
If oPage.WebEdit("name:="& Objname).Exist Then
oPage.WebEdit("name:="& Objname).Highlight
oPage.WebEdit("name:="& Objname).Set Testvalue
Reporter.ReportEvent micPass,"WebEdit Exist","Set
the"&Testvalue
Else
Reporter.ReportEvent micFail,"WebEdit not Exist","Not
set the"&Testvalue
End If
Case "Image"
If oPage.Image("name:="& Objname).Exist Then
oPage.Image("name:="& Objname).Highlight
oPage.Image("name:="& Objname).Click
Reporter.ReportEvent micPass,"Image Exist","Complted
click task"
Else
Reporter.ReportEvent micFail,"Image not Exist","Not
completed click task"
End If
Case "Link"
If oPage.Link("name:="& Objname).Exist Then
oPage.Link("name:="& Objname).Highlight
oPage.Link("name:="& Objname).Click
Reporter.ReportEvent micPass,"Link Exist","Complted
click task"
Else
Reporter.ReportEvent micFail,"Link not Exist","Not
completed click task"
End If
Case "WebList"
If oPage.WebList("name:="& Objname).Exist Then
oPage.WebList("name:="& Objname).Highlight
oPage.WebList("name:="& Objname).Select Testvalue
Reporter.ReportEvent micPass,"WebList
Exist","Selection done"
Else
Reporter.ReportEvent micFail,"WebList not
Exist","Selection not done"
End If
End Select
End Function
Is This Answer Correct ? | 0 Yes | 0 No |
How should i Create Email invite with server-side Coding?
What is the main difference between function and sub-procedure?
If a calulator having 3 buttons (of any number)in 3 of them one is not working properly due to which answer is wrong always. write a script to find out which button is not working properly ?
how to find the textfile in the folder and copy file from one folder to another folder useing parameterigation in QTP
What are the disadvantages of vbscript?
what does create object actually do when you call it in vbscript?
Write a vbscript procedure that converts feet to inches. Hint: there are 12 inches in a foot?
Can anyone help me in write coding to get this pattern * ** *** ****
how to organize files in object repository of qtp
What is the use of option explicit in vbscript?
Explain the extension .hta?
Explain How do you create a recordset object in vbscript?