write generic functions for webapplication?like
generic function for webedit
generic function for webbutton
generic function for links



write generic functions for webapplication?like generic function for webedit generic function for ..

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

Post New Answer

More VB Script Interview Questions

What are the advantages of vbscript?

0 Answers  


how do you make the variable declaration mandatory?what is the use of "option explicit"?

2 Answers  


we executed QTP scripts in one browser(i.e IN)same scripts is working on another browsers or not (i.e mean netscap,m azol..like )

6 Answers   Accenture,


write a program to display the system specifications of client system with the help of vb script.

1 Answers  


Explain about the extension .hta?

0 Answers  






Difference between Function and Sub routine?

0 Answers   Polaris,


what is resorceallocation

0 Answers  


How to open excel in vb script?

0 Answers  


How will you get a subset of a array in vbscript?

0 Answers  


What is Procedure or Subroutine in VB Script?

0 Answers  


Which loop is used in case of arrays in the vbscript language?

0 Answers  


How to Import data from a file (file is on the desktop) to the data table

0 Answers   IBM,


Categories