write generic functions for webapplication?like
generic function for webedit
generic function for webbutton
generic function for links
Answer Posted / 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 |
Post New Answer View All Answers
Plzzzzzzz can any one tell me which is the best institute in hyderabad for learing VBScript. plz do answer guys its urgent plzzzzzzz. thanks in advance.
What is event handling in vbscript?
what is inner join? what is outer join? what is a constraint? tell me about rdbms? tell me about acid properties?
Mention what is variant in vbscript?
Explain the .wsf files?
How will you get the natural logarithm of the given number in vbscript?
Explain the support of asp for vb script functionality?
What is the purpose of the err object in the vbscript language?
i have a problem with this error(this error related edit and
delete button,when i click this button in datagrid..i will
get this error)"Invalid postback or callback argument.
Event validation is enabled using
Mention what is vbscript?
Give me sm ideas to write Vbscripts abt protocol testing abilash700@gmail.com.
Explain the scope of the variables using dim, public, and private keywords respectively.
about vb scripting programs this type of all question& answers
hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?
What is the difference between vb debugger and the script debugger?