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


Please Help Members By Posting Answers For Below Questions

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.

1834


What is event handling in vbscript?

686


what is inner join? what is outer join? what is a constraint? tell me about rdbms? tell me about acid properties?

1519


Mention what is variant in vbscript?

636


Explain the .wsf files?

615






How will you get the natural logarithm of the given number in vbscript?

686


Explain the support of asp for vb script functionality?

716


What is the purpose of the err object in the vbscript language?

725


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 in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation." this is my code : <%@ Page Language="VB" Debug="false" %> <%@ import Namespace="Sytem.Data" %> <%@ import Namespace="System.Data.OleDB" %>

(Search Based On Staff I.C No) IC.No (XXXXXX-XX-XXXX)   ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> Total Leave Taken : Days

2412


Mention what is vbscript?

674


Give me sm ideas to write Vbscripts abt protocol testing abilash700@gmail.com.

1710


Explain the scope of the variables using dim, public, and private keywords respectively.

805


about vb scripting programs this type of all question& answers

1786


hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?

1893


What is the difference between vb debugger and the script debugger?

684