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 |
can u test the application without add-in?
how to genarate a random numbers in vb?
Explain some uses of vb script?
VBscript for QTP,best tutorial?
What purpose does ‘on error resume next’ serves?
How will you convert a string to upper case string using vbscript?
i have to open a notepad having no. of words in dat file by recording in qtp and then find a particular word and display true or false
hi, How will write a regular expression of date in VB scripting.
Explain about the support of asp for vb script functionality?
Explain the functionality of vbscript?
Hi all..I have two values. a=20 ,b=30 I want to perform c= a+b and c= a*b using user define function.please anyone give the answer
Which operator is used to perform the comparison among 2 operands in the vbscript language?