Vous êtes sur la page 1sur 49

KeywordFrameworkWeb ----------------------------------------'-----------------------------------------------------------------------------------------------------' Westpac Keyword Framework Web Library 'Script Name: KeywordFrameworkWeb.

vbs 'Authors: Vivek Kumar & Patrick Tsang ' Built and Customised for Westpac Banking Corporation 'Dates: 12-July-2007 'Purpose: Contains Web Keyword Framework Functionality. Provides support for managing ' Web and Browser objects as part of the Westpac Keyword Framewor k 'Parameters: N/A 'Pre and Post Conditions: N/A 'Script Version: N/A '------------------------------------------------------------------------------------------------------'Additional Requirements: ' ' This Library requires the following CONSTANTS to be declared, which are specif ic to each deployment of the Framework: ' DATAFILEPATH ' KEYWORDFILEPATH ' RESULTSPATH ' FRAMEWORKPATH ' BITMAP_OUTPUT_PATH (If Bitmap captures are used) ' ' The following Functions and Sub Procedures must be provided elsewhere ' '------------------------------------------------------------------------------------------------------'Function/Sub Procedure List: ' ' Function f_SelectButton ' Sub s_ProcessStep_WebEdit ' Sub s_ProcessStep_WebButton ' Sub s_ProcessStep_WebList ' Sub s_ProcessStep_WebLink ' Sub s_ProcessStep_WebCheckBox ' Sub s_ProcessStep_WebRadioGroup ' Sub s_ProcessStep_WebLinkByText ' Sub s_ProcessStep_WebLinkByPartialText ' Sub s_ProcessStep_WebTable ' Sub s_ProcessStep_WebWindow ' Sub s_ProcessStep_WindowClick ' Sub s_ProcessStep_WindowResize ' Sub s_ProcessStep_Frame ' Function f_DetermineWebTableCol ' Function f_DetermineWebTableRow '------------------------------------------------------------------------------------------------------'Amendments: '------------------------------------------------------------------------------------------------------'=============================================================== ' ' Start of Web Object Handling Sub Procedures '

'===============================================================

Sub s_ProcessStep_WebEdit Dim v_WebEditValue 'Preset v_rc to false in case of runtime error where object does not exist in Object repository v_rc = False ' Check that Edit exists v_rc = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow) .WebEdit(v_FrameworkObject).Exist(10) If v_FrameworkMethod="VerifyExists" Then If v_Param1="True" Then If v_rc=True Then s_FrameworkReportOutput "Edit field exists (" & v_Framew orkObject & ")", 2, micPass Else s_FrameworkReportError "Edit: " & v_FrameworkObject & " field does not exist" End If Elseif v_Param1="False" Then If v_rc=False Then s_FrameworkReportOutput "Edit field does not exist (" & v_FrameworkObject & ")", 2, micPass Else s_FrameworkReportError "Edit: " & v_FrameworkObject & " field exists" End If End If Else If v_rc = False Then s_FrameworkReportError "Edit: " & v_FrameworkObject & "Coul d not be found! Step being skipped, but test will likely fail" Exit Sub End If End If Select Case v_FrameworkMethod Case "Clear" Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Click Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Set "" Case "Set" Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Click Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Set "" Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Set Trim(v_Param1) Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Click Case "Click" Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Click Case "Enter"

v_Text_Window=Browser(v_FrameworkBrowserWindow).GetROPropert y("text") Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Click Window("text:=" & v_Text_Window).Type micReturn Case "Get" DataTable("Param1", v_SheetName) = Browser(v_FrameworkBrowse rWindow).Page(v_FrameworkPageWindow).WebEdit(v_FrameworkObject).GetROProperty("v alue") Case "Verify" v_WebEditValue = Browser(v_FrameworkBrowserWindow).Page(v_Fr ameworkPageWindow).WebEdit(v_FrameworkObject).GetROProperty("value") If v_Param1 = v_WebEditValue Then s_FrameworkReportOutput "Edit Value is Correct (" & v_We bEditValue & ")", 2, micPass Else s_FrameworkReportOutput "Edit Value is incorrect, '" & v _WebEditValue & "' instead of: '"+ V_Param1 + "'", 2, micFail End If Exit Sub Case "VerifyNot" v_WebEditValue = Browser(v_FrameworkBrowserWindow).Page(v_Fr ameworkPageWindow).WebEdit(v_FrameworkObject).GetROProperty("value") If v_Param1 = v_WebEditValue Then s_FrameworkReportOutput "Edit Value incorrectly matches param1(" & v_WebEditValue & ")", 2, micFail Else s_FrameworkReportOutput "Edit Value (" & v_WebEditValue & ")" & " does not match Param1 (" & v_Param1 & ")", 2, micPass End If Exit Sub Case "VerifyProperty" Dim v_PropertyValue v_PropertyValue = Browser(v_FrameworkBrowserWindow).Page(v_F rameworkPageWindow).WebEdit(v_FrameworkObject).GetROProperty(v_Param1) If CStr(v_PropertyValue) = CStr(v_Param2) Then s_FrameworkReportOutput "Edit Property Value is Correct (" & v_PropertyValue & ")", 2, micPass Else s_FrameworkReportOutput "Edit Property Value is incorrec t, '" & v_PropertyValue & "' instead of: '" & v_Param2 & "'", 2, micFail End If Exit Sub Case "VerifyEnabledDisabled" '--- ( VK Corrected as it was pb but ton ) Dim v_EditFieldStatus v_EditFieldStatus= Browser(v_FrameworkBrowserWindow).Page(v_ FrameworkPageWindow).WebEdit(v_FrameworkObject).GetROProperty("disabled") If v_Param1 = "Enabled" And v_EditFieldStatus= "0" Then s_FrameworkReportOutput "Expected Edit Field status is E nabled", 2, micPass 'The Edit Field status for being disabled is 1 and the enabl ed is 0 - inconsistency in the application. Else If v_Param1 = "Disabled" And v_EditFieldStatus= "1" The n s_FrameworkReportOutput "Expected button status is Disab led", 2, micPass Else

s_FrameworkReportOutput "Unexpected button status ex ists", 2, micFail End If End If Case "VerifyExists" Exit Sub Case Else s_FrameworkReportError "This Method is not Built" Exit Sub End Select ' If the Code gets here, we have completed without error. Report this to the log s_FrameworkReportOutput "Completed Successfully", 2, micDone End Sub Sub s_ProcessStep_WebEdit Dim v_WebEditValue 'Preset v_rc to false in case of runtime error where object does not exist in Object repository v_rc = False ' Check that Edit exists v_rc = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow) .WebEdit(v_FrameworkObject).Exist(10) If v_FrameworkMethod="VerifyExists" Then If v_Param1="True" Then If v_rc=True Then s_FrameworkReportOutput "Edit field exists (" & v_Framew orkObject & ")", 2, micPass Else s_FrameworkReportError "Edit: " & v_FrameworkObject & " field does not exist" End If Elseif v_Param1="False" Then If v_rc=False Then s_FrameworkReportOutput "Edit field does not exist (" & v_FrameworkObject & ")", 2, micPass Else s_FrameworkReportError "Edit: " & v_FrameworkObject & " field exists" End If End If Else If v_rc = False Then s_FrameworkReportError "Edit: " & v_FrameworkObject & "Coul d not be found! Step being skipped, but test will likely fail" Exit Sub End If End If Select Case v_FrameworkMethod Case "Clear" Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Click Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Set "" Case "Set" Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow

).WebEdit(v_FrameworkObject).Click Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Set "" Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Set Trim(v_Param1) Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Click Case "Click" Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Click Case "Enter" v_Text_Window=Browser(v_FrameworkBrowserWindow).GetROPropert y("text") Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebEdit(v_FrameworkObject).Click Window("text:=" & v_Text_Window).Type micReturn Case "Get" DataTable("Param1", v_SheetName) = Browser(v_FrameworkBrowse rWindow).Page(v_FrameworkPageWindow).WebEdit(v_FrameworkObject).GetROProperty("v alue") Case "Verify" v_WebEditValue = Browser(v_FrameworkBrowserWindow).Page(v_Fr ameworkPageWindow).WebEdit(v_FrameworkObject).GetROProperty("value") If v_Param1 = v_WebEditValue Then s_FrameworkReportOutput "Edit Value is Correct (" & v_We bEditValue & ")", 2, micPass Else s_FrameworkReportOutput "Edit Value is incorrect, '" & v _WebEditValue & "' instead of: '"+ V_Param1 + "'", 2, micFail End If Exit Sub Case "VerifyNot" v_WebEditValue = Browser(v_FrameworkBrowserWindow).Page(v_Fr ameworkPageWindow).WebEdit(v_FrameworkObject).GetROProperty("value") If v_Param1 = v_WebEditValue Then s_FrameworkReportOutput "Edit Value incorrectly matches param1(" & v_WebEditValue & ")", 2, micFail Else s_FrameworkReportOutput "Edit Value (" & v_WebEditValue & ")" & " does not match Param1 (" & v_Param1 & ")", 2, micPass End If Exit Sub Case "VerifyProperty" Dim v_PropertyValue v_PropertyValue = Browser(v_FrameworkBrowserWindow).Page(v_F rameworkPageWindow).WebEdit(v_FrameworkObject).GetROProperty(v_Param1) If CStr(v_PropertyValue) = CStr(v_Param2) Then s_FrameworkReportOutput "Edit Property Value is Correct (" & v_PropertyValue & ")", 2, micPass Else s_FrameworkReportOutput "Edit Property Value is incorrec t, '" & v_PropertyValue & "' instead of: '" & v_Param2 & "'", 2, micFail End If Exit Sub Case "VerifyEnabledDisabled" '--- ( VK Corrected as it was pb but ton ) Dim v_EditFieldStatus v_EditFieldStatus= Browser(v_FrameworkBrowserWindow).Page(v_ FrameworkPageWindow).WebEdit(v_FrameworkObject).GetROProperty("disabled")

If v_Param1 = "Enabled" And v_EditFieldStatus= "0" Then s_FrameworkReportOutput "Expected Edit Field status is E nabled", 2, micPass 'The Edit Field status for being disabled is 1 and the enabl ed is 0 - inconsistency in the application. Else If v_Param1 = "Disabled" And v_EditFieldStatus= "1" The n s_FrameworkReportOutput "Expected button status is Disab led", 2, micPass Else s_FrameworkReportOutput "Unexpected button status ex ists", 2, micFail End If End If Case "VerifyExists" Exit Sub Case Else s_FrameworkReportError "This Method is not Built" Exit Sub End Select ' If the Code gets here, we have completed without error. Report this to the log s_FrameworkReportOutput "Completed Successfully", 2, micDone End Sub ' Function to determine whether a button is an Image, ImageMap, etc. Function f_SelectButton On Error Resume Next Dim v_rc, v_rc2,v_rc4, v_ButtonFlag v_ButtonFlag = "No Button" 'Check to see which button is being used, or is none exists v_rc4=Dialog(v_FrameworkBrowserWindow).Dialog(v_FrameworkPageWindow).WinButt on(v_FrameworkObject).Exist(0) If v_rc4 = "True" Then v_ButtonFlag = "DialogDialog" '' Updated End If v_rc3 = Browser(v_FrameworkBrowserWindow).Dialog(v_FrameworkPageWindow).WinB utton(v_FrameworkObject).Exist(0) If v_rc3 = "True" Then v_ButtonFlag = "Dialog" '' Updated End If v_rc = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Image(v _FrameworkObject).Exist(0) If v_rc = "True" Then v_ButtonFlag = "Image" End If v_rc2 = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).WebBut ton(v_FrameworkObject).Exist(0) If v_rc2 = "True" Then v_ButtonFlag = "WebButton" End If DataTable.GetSheet(v_SheetName).SetCurrentRow v_SheetRowNum 'Code added to o vercome strange QTP behaviour f_SelectButton = v_ButtonFlag

End Function Sub s_ProcessStep_WebList Dim v_WebListValue, v_WebListIndex 'Preset v_rc to false in case of runtime error where object does not exist in Object repository v_rc = False ' Check that WebList exists v_rc = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow) .WebList(v_FrameworkObject).Exist If v_rc = False Then s_FrameworkReportError "List: " & v_FrameworkObject & "Could no t be found! Step being skipped, but test will likely fail" Exit Sub End If Select Case v_FrameworkMethod Case "Select" Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebList(v_FrameworkObject).Select v_Param1 Case "Click" Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebList(v_FrameworkObject).Click Case "GetValueCount" DataTable("Param1", v_SheetName) = Browser(v_FrameworkBrowse rWindow).Page(v_FrameworkPageWindow).WebList(v_FrameworkObject).GetROProperty("s elected items count") Case "Get" v_WebListIndex = Browser(v_FrameworkBrowserWindow).Page(v_Fr ameworkPageWindow).WebList(v_FrameworkObject).GetROProperty("selected item index ") DataTable("Param1", v_SheetName) = Browser(v_FrameworkBrowse rWindow).Page(v_FrameworkPageWindow).WebList(v_FrameworkObject).GetItem(CInt(v_W ebListIndex)+1) Case "Verify" v_WebListIndex = Browser(v_FrameworkBrowserWindow).Page(v_Fr ameworkPageWindow).WebList(v_FrameworkObject).GetROProperty("selected item index ") v_WebListValue = Browser(v_FrameworkBrowserWindow).Page(v_Fr ameworkPageWindow).WebList(v_FrameworkObject).GetItem(CInt(v_WebListIndex)+1) v_InputParam=UCase(Replace(v_Param1," ","")) v_CellValue=UCase(Replace(v_WebListValue ," ","")) If (v_CellValue= v_InputParam) Then s_FrameworkReportOutput "List Value is Correct", 2, micP ass Else s_FrameworkReportOutput "List Value is incorrect, "+ v_W ebListValue + " instead of: "+ v_Param1, 2, micFail End If Exit Sub Case "VerifyItemsCount" ' PT 04/07/07 v_WebListValue = Browser(v_FrameworkBrowserWindow).Page(v_Fr ameworkPageWindow).WebList(v_FrameworkObject).GetROProperty("items count") If Trim(CStr(v_WebListValue)) = Trim(CStr(v_Param1)) Then s_FrameworkReportOutput "List items count is Correct", 2, micPass

Else s_FrameworkReportOutput "List items count is incorrect", 2, micFail End If Case "VerifyDefaultValue" '- PT 19/06/2007 v_WebListValue = Browser(v_FrameworkBrowserWindow).Page(v_Fr ameworkPageWindow).WebList(v_FrameworkObject).GetROProperty("default value") If v_Param1 = v_WebListValue Then s_FrameworkReportOutput "List Default Value is Correct", 2, micPass Else s_FrameworkReportOutput "List Default Value is incorrect , "+ v_WebListValue + " instead of: "+ v_Param1, 2, micFail End If Case "VerifyListValue" '-PT 13/06/07 'This verifies a value that exists in the list without havin g to select the value first. 'Param1 is the value you are verifying exists in the list. Dim v_WebListItems, i, v_WebListMax, v_WebListArray v_WebListMax = Browser(v_FrameworkBrowserWindow).Page(v_Fram eworkPageWindow).WebList(v_FrameworkObject).GetROProperty("items count") v_WebListItems = Browser(v_FrameworkBrowserWindow).Page(v_Fr ameworkPageWindow).WebList(v_FrameworkObject).GetROProperty("all items") If Instr(1, v_WebListItems, "; Tijuana")>0 Then v_WebListItems= Replace(v_WebListItems,"; Tijuana",": Ti juana") End If v_WebListArray = Split (v_WebListItems, ";", -1) If Instr(1,v_Param1,";")>0 Then v_Param1=Replace(v_Param1,";",":") End If For i = 0 To v_WebListMax-1 'v_WebListIndex = Browser(v_FrameworkBrowserWindow).Page(v_F rameworkPageWindow).WebList(v_FrameworkObject).GetROProperty("selected item inde x") If v_Param1 = v_WebListArray(i) Then s_FrameworkReportOutput "List Value exists", 2, micP ass Exit Sub End If Next s_FrameworkReportOutput "List Value does not exist, "+ v_Web ListValue + " instead of: "+ v_Param1, 2, micFail Exit Sub Case "GetListValues" ' PT 13/06/07 'This gets all the values in a weblist and outputs them to t he parameter fields. 'Note there is a limit of 5! Dim v_ListItems, j, v_ListMax, v_ListArray v_ListMax = Browser(v_FrameworkBrowserWindow).Page(v_Framewo rkPageWindow).WebList(v_FrameworkObject).GetROProperty("items count") v_ListItems = Browser(v_FrameworkBrowserWindow).Page(v_Frame workPageWindow).WebList(v_FrameworkObject).GetROProperty("all items") v_ListArray = Split (v_ListItems, ";", -1)

For j = 0 To v_ListMax-1 'v_WebListIndex = Browser(v_FrameworkBrowserWindow).Page(v_F rameworkPageWindow).WebList(v_FrameworkObject).GetROProperty("selected item inde x") DataTable("Param" & j+1, v_SheetName) = v_ListArray(j) Next s_FrameworkReportOutput "Get list values successful", 2, mic Pass Exit Sub Case "VerifyChar" '-vivek 'Verify if character Exist with in Entire List Field 'Param1 is the Specify char that is to be checked with entir e weblist Dim v_flag,v_ItemCount,v_ListItem,v_ArrayList,v_Choose v_flag="No" v_ItemCount = Browser(v_FrameworkBrowserWindow).Page(v_Frame workPageWindow).WebList(v_FrameworkObject).GetROProperty("items count") v_ListItem = Browser(v_FrameworkBrowserWindow).Page(v_Framew orkPageWindow).WebList(v_FrameworkObject).GetROProperty("all items") v_ArrayList = Split(v_ListItems, ";",-1) For i = 1 To v_ItemCount-1 v_Choose=v_ArrayList(i) v_MyPos = InStr(v_ArrayList(i),v_Param1) If (v_MyPos >0) Then v_Flag="Yes" Else v_Flag="No" End If Next If (v_Flag="Yes") Then s_FrameworkReportOutput "List Value exists", 2, micP ass Exit Sub ElseIf (v_Flag="No") Then s_FrameworkReportOutput "List Value does not exist, "+ v_WebListValue + " instead of: "+ v_Param1, 2, micFail Exit Sub End If Case Else s_FrameworkReportError "Unknown method attempted against Li st Object" Exit Sub End Select ' If the Code gets here, we have completed without error. Report thi s to the log s_FrameworkReportOutput "Completed Successfully", 2, micDone End Sub Sub s_ProcessStep_WebButton ' Currently, two buttons exist Images and WebButton. Should this change , this sub should be updated wait(1) Dim v_ButtonFlag, v_ButtonExists

'Call Function to find which button exists v_ButtonFlag = f_SelectButton Select Case v_FrameworkMethod Case "VerifyEnabledDisabled" Dim v_ButtonStatus v_ButtonStatus = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkP ageWindow).WebButton(v_FrameworkObject).GetROProperty("disabled") If v_Param1 = "Enabled" And v_ButtonStatus = False Then s_FrameworkReportOutput "Expected button status exists", 2, micP ass 'The button status for being disabled is 1 and the enabled is 0 Else If v_Param1 = "Disabled" And v_ButtonStatus = "1" Then s_FrameworkReportOutput "Expected button status exists", 2, micPass Else s_FrameworkReportOutput "Unexpected button status exists", 2 , micFail End If End If Case "GetExists" If v_ButtonFlag = "No Button" Then DataTable("Param1", v_SheetName) = "False" Else DataTable("Param1", v_SheetName) = "True" End If Case "VerifyExists" If v_ButtonFlag = "No Button" Then v_ButtonExists = "False" Else v_ButtonExists = "True" End If If v_Param1 = v_ButtonExists Then Select Case v_Param1 Case "True" s_FrameworkReportOutput "Expected Button exists", 2, micPass Case "False" s_FrameworkReportOutput "Button does not exist", 2, micPass End Select Else Select Case v_Param1 Case "True" s_FrameworkReportOutput "Expected Button does not ex ist", 2, micFail Case "False" s_FrameworkReportOutput "Unexpected Button exist", 2 , micFail End Select End If Exit Sub Case Else

Select Case v_ButtonFlag Case "WebButton" Select Case v_FrameworkMethod Case "Click" Browser(v_FrameworkBrowserWindow).Page(v _FrameworkPageWindow).WebButton(v_FrameworkObject).Click Case Else s_FrameworkReportError "Unknown method attempted against Button Object: " & v_FrameworkMethod Exit Sub End Select Case "DialogDialog" ' Vk 26/07/07 Select Case v_FrameworkMethod Case "Click" Dialog(v_FrameworkBrowserWindow).Dialog( v_FrameworkPageWindow).WinButton(v_FrameworkObject).Click Case Else s_FrameworkReportError "Unknown method attempted against Button Object: " & v_FrameworkMethod Exit Sub End Select

Case "Dialog" Select Case v_FrameworkMethod Case "Click" Browser(v_FrameworkBrowserWindow).Dialog (v_FrameworkPageWindow).WinButton(v_FrameworkObject).Click Case Else s_FrameworkReportError "Unknown method attempted against Button Object: " & v_FrameworkMethod Exit Sub End Select Case "Image" Select Case v_FrameworkMethod Case "VerifyImageExist" v_Found=Browser(v_FrameworkBrowserWindow) .Page(v_FrameworkPageWindow).Image(v_FrameworkObject).Exist If v_Found Then s_FrameworkReportOutput "Image Exis ts !!! ", 2, micPass End If Case "Click" Browser(v_FrameworkBrowserWindow).Page(v _FrameworkPageWindow).Image(v_FrameworkObject).Click Case "VerifyProperty" v_Property=Browser(v_FrameworkBrowserWin dow).Page(v_FrameworkPageWindow).Image(v_FrameworkObject).GetROProperty(v_Param1 ) If InStr(1, v_Property, v_Param2)>0 Then s_FrameworkReportOutput "Image prope rty is valid. Expected Property/Value= " & v_Param1 & "/" & v_Param2 , 2, micPas s Else s_FrameworkReportError "Image prope

rty is invalid. Expected Property/Value= " & v_Param1 & "/" & v_Param2 & " Actua l Value=" & v_Property End If Case Else s_FrameworkReportError "Unknown method attempted against Button Object: " & v_FrameworkMethod Exit Sub End Select Case Else s_FrameworkReportError "Button: " & v_Framework Object & "Could not be found! Step being skipped, but test will likely fail" Exit Sub End Select End Select ' If the Code gets here, we have completed without error. Report this to the log s_FrameworkReportOutput "Completed Successfully", 2, micDone '' End Sub ' Moved to CIS_KeywordFrameworkImpl Rem Sub s_ProcessStep_WebCombiBox Rem 'CombiBox is made up of more than object, WebEdit and then WebList on We bedit is clicked Rem ' Check that WebEdit exists Rem Dim v_CombiName, v_ListCount, v_CombiValue Rem v_CombiName = Right(DataTable("Object", v_SheetName),Len(DataTab le("Object", v_SheetName))-3) Rem 'Preset v_rc to false in case of runtime error where object does not exist in Object repository Rem v_rc = False Rem v_rc = Browser(DataTable("Window", v_SheetName)).Page(DataTable( "Window", v_SheetName)).WebEdit("ed_"+V_CombiName).Exist(0) Rem If v_rc = False Then Rem s_FrameworkReportError "CombiBox: " & DataTable("Object", v _SheetName) & "Could not be found! Step being skipped, but test will likely fai l" Rem Exit Sub Rem End If Rem Select Case DataTable("Method", v_SheetName) Rem Case "Select" Rem Browser(DataTable("Window", v_SheetName)).Page(DataTable ("Window", v_SheetName)).WebEdit("ed_"+V_CombiName).Click Rem 'Preset v_rc to false in case of runtime error where obj ect does not exist in Object repository Rem v_rc = False Rem 'Check if WebList part of object exists Rem v_rc = Browser(DataTable("Window", v_SheetName)).Page(Da taTable("Window", v_SheetName)).WebList("wl_"+V_CombiName).Exist(0) Rem If v_rc = False Then Rem s_FrameworkReportError "CombiBox: " & DataTable("Ob ject", v_SheetName) & "Could not be found! Step being skipped, but test will li kely fail" Rem Exit Sub Rem End If Rem Browser(DataTable("Window", v_SheetName)).Page(DataTable ("Window", v_SheetName)).WebList("wl_"+v_CombiName).Select DataTable("Param1", v

_SheetName) Rem Browser(DataTable("Window", v_SheetName)).Page(DataTable ("Window", v_SheetName)).WebList("wl_"+v_CombiName).Click Rem Browser(DataTable("Window", v_SheetName)).Page(DataTable ("Window", v_SheetName)).WebEdit("ed_"+v_CombiName).Click Rem Case "SelectByIndex" Rem Browser(DataTable("Window", v_SheetName)).Page(DataTable ("Window", v_SheetName)).WebEdit("ed_"+v_CombiName).Click Rem 'Preset v_rc to false in case of runtime error where obj ect does not exist in Object repository Rem v_rc = False Rem 'Check if WebList part of object exists Rem v_rc = Browser(DataTable("Window", v_SheetName)).Page(Da taTable("Window", v_SheetName)).WebList("wl_"+v_CombiName).Exist(0) Rem If v_rc = False Then Rem s_FrameworkReportError "CombiBox: " & DataTable("Ob ject", v_SheetName) & "Could not be found! Step being skipped, but test will li kely fail" Rem Exit Sub Rem End If Rem v_Param1 = f_ParseParam(DataTable("Param1", v_SheetName) ) Rem v_Param1 = CInt(v_Param1) Rem v_ListCount = Browser(DataTable("Window", v_SheetName)). Page(DataTable("Window", v_SheetName)).WebList("wl_"+v_CombiName).GetROProperty( "items count") Rem If v_ListCount < v_Param1 Then Rem s_FrameworkReportOutput "Value is not in Combibox", 2, micFail Rem Else Rem v_CombiValue = Browser(DataTable("Window", v_SheetNa me)).Page(DataTable("Window", v_SheetName)).WebList("wl_"+v_CombiName).GetItem(v _Param1) Rem Browser(DataTable("Window", v_SheetName)).Page(DataT able("Window", v_SheetName)).WebList("wl_"+v_CombiName).Select v_CombiValue Rem Browser(DataTable("Window", v_SheetName)).Page(DataT able("Window", v_SheetName)).WebList("wl_"+v_CombiName).Click Rem Browser(DataTable("Window", v_SheetName)).Page(DataT able("Window", v_SheetName)).WebEdit("ed_"+v_CombiName).Click Rem End If Rem Case "Get" Rem DataTable("Param1", v_SheetName) = Browser(DataTable("Wi ndow", v_SheetName)).Page(DataTable("Window", v_SheetName)).WebEdit("ed_"+v_Comb iName).GetROProperty("value") Rem Browser(DataTable("Window", v_SheetName)).Page(DataTable ("Window", v_SheetName)).WebList("wl_"+v_CombiName).Click Rem Browser(DataTable("Window", v_SheetName)).Page(DataTable ("Window", v_SheetName)).WebEdit("ed_"+v_CombiName).Click Rem Case "Verify" Rem v_Param1 = f_ParseParam(DataTable("Param1", v_SheetName) ) Rem v_CombiValue = Browser(DataTable("Window", v_SheetName)) .Page(DataTable("Window", v_SheetName)).WebEdit("ed_"+v_CombiName).GetROProperty ("value") Rem If v_Param1 = v_CombiValue Then Rem s_FrameworkReportOutput "CombiBox Value is Correct", 2, micPass Rem Else Rem s_FrameworkReportOutput "CombiBox Value is incorrect , "+ v_CombiValue + " instead of: "+ v_Param1, 2, micFail

Rem End If Rem Exit Sub Rem Case Else Rem s_FrameworkReportError "Unknown method attempted agains t CombiBox Object" Rem Exit Sub Rem End Select Rem ' If the Code gets here, we have completed without error. Report this to the log Rem s_FrameworkReportOutput "Completed Successfully", 2, micDone Rem End Sub Sub s_ProcessStep_WebLink 'Preset v_rc to false in case of runtime error where object does not exist i n Object repository v_rc = False ' Check that WebLink exists v_rc = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Link(v_ FrameworkObject).Exist If v_rc = False Then s_FrameworkReportError "Link: " & v_FrameworkObject & "Could not be fou nd! Step being skipped, but test will likely fail" Exit Sub End If Select Case v_FrameworkMethod Case "Verify" Dim v_WebLinkValue v_WebLinkValue = Browser(v_FrameworkBrowserWindow).Page(v_Framewo rkPageWindow).Link(v_FrameworkObject).GetROProperty("text") If InStr(v_WebLinkValue,v_Param1) Then s_FrameworkReportOutput "Selection Link Value is Correct", 2, mi cPass Else s_FrameworkReportOutput "Selection Link Value is incorrect, "+ v _WebLinkValue + " instead of: "+ v_Param1, 2, micFail End If Exit Sub Case "Click" Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Link(v _FrameworkObject).Click Case Else s_FrameworkReportError "Unknown method attempted against List Objec t" Exit Sub End Select ' If the Code gets here, we have completed without error. Report this to the log s_FrameworkReportOutput "Completed Successfully", 2, micDone End Sub Sub s_ProcessStep_Frame 'Preset v_rc to false in case of runtime error where object does not exist in Object repository Dim v_rf v_rf = False

' Check that WebLink exists - BELOW HAS BEEN COMMENTED OUT BECAUSE OF BUGS P T 27/06/07 ' Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Sync 'PT 26/0 6/07 ' v_rf = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Frame( v_FrameworkObject).Exist ' If v_rf = False Then ' s_FrameworkReportError "Frame: " & v_FrameworkObject & "Could not be f ound! Step being skipped, but test will likely fail" 'Exit Sub ' End If Select Case v_FrameworkMethod Case "VerifyWebElement" v_Exist = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow). Frame(v_FrameworkObject).WebElement(v_Param1).Exist If v_Exist Then v_GetROProperty = Browser(v_FrameworkBrowserWindow).Page(v_Framework PageWindow).Frame(v_FrameworkObject).WebElement(v_Param1).GetROProperty("innerte xt") v_TextValue=UCase(Replace(v_GetROProperty," ","")) v_InputParam=UCase(Replace(v_Param2," ","")) If (v_TextValue=v_InputParam) Then s_FrameworkReportOutput "WebElement Value is Correct (" & v_Para m2& ")", 2, micPass Else s_FrameworkReportOutput "WebElement Value Doesnt Match !!!! Ac tual Value:"& v_GetROProperty & "Entered:"& v_Param2& "'", 2, micFail End If Else s_FrameworkReportOutput "WebElement Value Not Found !!! "& v_Para m2& "'", 2, micFail End If Exit Sub Case "VerifyCellByRef" ' WebTable Dim v_WebTableCurrentValue 'v_frameworkObject=contain frame Object;v_Param1=(Presently can be webtable Or image button); 'v_Param2,3,4,5= contain variables for frame objects ' This method will be updated so that v_Param1 contains EITHER the r ow number, OR the syntax x=Value, where x is the column to look in for Value ' The same will be done for v_Param2, except for Column rather than row. This allows combinations such as: ' 3, 2 means Row 3, Column 2 ' 3, 1=Name means Row 3, and the Column that contains Name in Row 1 (ie, Name is the Column heading, with headings store d in Row 1) ' 1=Customer, 1=Name means The Row that has Custo mer as a value in Column 1 (ie a row heading of Customer, with headings stored i n Column 1), and the same column as in the above example Dim v_ValuePassed v_ValuePassed= Trim(Browser(v_FrameworkBrowserWindow).Page(v_Framewo rkPageWindow).Frame(v_FrameworkObject).WebTable(v_Param1).GetCellData(v_Param2, v_Param3))

If InStr(Trim(v_ValuePassed),Trim(v_Param4)) >0 Then s_FrameworkReportOutput "WebTable Value is Correct (" & v_WebTable CurrentValue & ")", 2, micPass Else s_FrameworkReportOutput "WebTable Value is incorrect, '" & v_Web TableCurrentValue & "' instead of: '"& v_Param4 & "'", 2, micFail End If Exit Sub Case "Select" ' Web Radio Group If Left(v_Param2, 5) = "<LAST" Then ' We want to select the last value, what ever that actually is v_ItemCount = Browser(v_FrameworkBrowserWindow).Page(v_Framework PageWindow).Frame(v_FrameworkObject).WebRadioGroup(v_Param1).GetROProperty("item s count") Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Fr ame(v_FrameworkObject).WebRadioGroup(v_Param1).Select "#" & v_ItemCount-1 ' -1 is used, as the items are 0 indexed. Else ' Normal selection based on input Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Fr ame(v_FrameworkObject).WebRadioGroup(v_Param1).Select v_Param2 End If Case "PbClick" Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Frame( v_FrameworkObject).WebButton(v_Param1).Click Case "Click" ' Web button ' Works only for Image ; Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Frame( v_FrameworkObject).Image(v_Param1).Click Case Else s_FrameworkReportError "Unknown method attempted against List Objec t" Exit Sub End Select ' If the Code gets here, we have completed without error. Report this to the log s_FrameworkReportOutput "Completed Successfully", 2, micDone End Sub Sub s_ProcessStep_WebCheckBox Dim v_WebCheckBoxValue, v_WebCheckBoxValue2 'Preset v_rc to false in case of runtime error where object does not exist i n Object repository v_rc = False ' Check that WebCheckBox exists v_rc = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).WebChec kBox(v_FrameworkObject).Exist If v_rc = False Then s_FrameworkReportError "CheckBox: " & v_FrameworkObject & "Could not be found! Step being skipped, but test will likely fail" Exit Sub End If Select Case v_FrameworkMethod Case "Set" Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).WebChe

ckBox(v_FrameworkObject).Set v_Param1 Case "SetName" Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).WebChe ckBox(v_FrameworkObject).SetTOProperty "name", v_Param1 Case "Get" v_WebCheckBoxValue = Browser(v_FrameworkBrowserWindow).Page(v_Framew orkPageWindow).WebCheckBox(v_FrameworkObject).GetROProperty("checked") If v_WebCheckBoxValue = 1 Then DataTable("Param1", v_SheetName) = "ON" ElseIf v_WebCheckBoxValue = 0 Then DataTable("Param1", v_SheetName) = "OFF" Else s_FrameworkReportError "Invalid Value returned by CheckBox Obje ct" End If Case "Verify" v_WebCheckBoxValue = Browser(v_FrameworkBrowserWindow).Page(v_Framew orkPageWindow).WebCheckBox(v_FrameworkObject).GetROProperty("checked") If v_WebCheckBoxValue = 1 Then v_WebCheckBoxValue2 = "ON" ElseIf v_WebCheckBoxValue = 0 Then v_WebCheckBoxValue2 = "OFF" Else s_FrameworkReportError "Invalid Value returned by CheckBox Obje ct" End If If v_Param1 = v_WebCheckBoxValue2 Then s_FrameworkReportOutput "CheckBox Value is Correct", 2, micPass Else s_FrameworkReportOutput "CheckBox Value is incorrect " + v_WebCh eckBoxValue2 + " instead of: "+ v_Param1, 2, micFail End If Exit Sub Case Else s_FrameworkReportError "Unknown method attempted against CheckBox O bject" Exit Sub End Select ' If the Code gets here, we have completed without error. Report this to the log s_FrameworkReportOutput "Completed Successfully", 2, micDone End Sub Sub s_ProcessStep_WebRadioGroup Dim v_ItemCount 'Preset v_rc to false in case of runtime error where object does not exist i n Object repository v_rc = False ' Check that WebRadioGroup exists v_rc = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).WebRadi oGroup(v_FrameworkObject).Exist If v_rc = False Then s_FrameworkReportError "SelectionGroup: " & v_FrameworkObject & "Could not be found! Step being skipped, but test will likely fail" Exit Sub End If Select Case v_FrameworkMethod Case "Select"

If Left(v_Param1, 5) = "<LAST" Then ' We want to select the last value, what ever that actually is v_ItemCount = Browser(v_FrameworkBrowserWindow).Page(v_Framework PageWindow).WebRadioGroup(v_FrameworkObject).GetROProperty("items count") Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).We bRadioGroup(v_FrameworkObject).Select "#" & v_ItemCount-1 ' -1 is used, as the items are 0 indexed. Else ' Normal selection based on input Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).We bRadioGroup(v_FrameworkObject).Select v_Param1 End If Case "Get" DataTable("Param1", v_SheetName) = Browser(v_FrameworkBrowserWindow) .Page(v_FrameworkPageWindow).WebRadioGroup(v_FrameworkObject).GetROProperty("val ue") Case "Verify" Dim v_WebRadioGroupValue v_WebRadioGroupValue = Browser(v_FrameworkBrowserWindow).Page(v_Fram eworkPageWindow).WebRadioGroup(v_FrameworkObject).GetROProperty("value") If InStr(v_WebRadioGroupValue,v_Param1) Then s_FrameworkReportOutput "Selection Group Value is Correct", 2, m icPass Else s_FrameworkReportOutput "Selection Group Value is incorrect, "+ v_WebRadioGroupValue + " instead of: "+ v_Param1, 2, micFail End If Exit Sub Case "GetItemsCount" 'The items count for the radio group is returned in the param 1 cell . - 11/06/07 PT DataTable("Param1", v_SheetName) = Browser(v_FrameworkBrowserWindow) .Page(v_FrameworkPageWindow).WebRadioGroup(v_FrameworkObject).GetROProperty("ite ms count") Case "VerifyEnabledDisabled" v_WebRadioGroupValue = Browser(v_FrameworkBrowserWindow).Page(v_Fram eworkPageWindow).WebRadioGroup(v_FrameworkObject).GetROProperty("checked") If v_WebRadioGroupValue = 1 Then v_WebRadioGroupValue2 = "ON" ElseIf v_WebRadioGroupValue= 0 Then v_WebRadioGroupValue2 = "OFF" Else s_FrameworkReportError "Invalid Value returned by RadioGroup Ob ject" End If If v_Param1 = v_WebRadioGroupValue2 Then s_FrameworkReportOutput "RadioGroup Value is Correct", 2, micPas s Else s_FrameworkReportOutput "RadioGroup Value is incorrect " + v_Web RadioGroupValue2 + " instead of: "+ v_Param1, 2, micFail End If Exit Sub Case Else s_FrameworkReportError "Unknown method attempted against SelectionG roup Object: " & v_FrameworkMethod

Exit Sub End Select ' If the Code gets here, we have completed without error. Report this to the log s_FrameworkReportOutput "Completed Successfully", 2, micDone End Sub Sub s_ProcessStep_WebLinkByText 'VK special char are taken care of " ' Check that Link exists If v_Param2 = "" Then v_Param2 = "0" Else v_Param2 = (v_Param2 - 1) End If v_Temp=v_Param1 'Coded * ' * # ( ) % ^ v_Temp1=Replace(v_Temp,"*","\*") v_Temp2=Replace(v_Temp1,"#","\#") v_Temp3=Replace(v_Temp2,"(","\(") v_Temp4=Replace(v_Temp3,")","\)") v_Temp5=Replace(v_Temp4,"'","\'") v_Temp6=Replace(v_Temp5,"'","\'") v_Temp7=Replace(v_Temp6,"%",".") v_Temp8=Replace(v_Temp7,"^","\^") 'Preset v_rc to false in case of runtime error where object does not exi st in Object repository ' v_rc = False v_rc = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Lin k("text:="&v_Temp8, "index:="&v_Param2).Exist If v_rc = False Then s_FrameworkReportError "Edit: " & v_Param1 & "Link text could not b e found! Step being skipped, but test will likely fail" Exit Sub End If Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Link("text :=" & v_Temp8, "index:=" & v_Param2).Click s_FrameworkReportOutput "Completed Successfully", 2, micDone End Sub Sub s_ProcessStep_WebLinkByPartialText ' Check that Link exists ' Param1 is the Link text. Param2 is the optional index (defaults to 0) If v_Param2 = "" Then v_Param2 = "0" Else v_Param2 = (v_Param2 - 1) End If 'Preset v_rc to false in case of runtime error where object does not exis t in Object repository v_rc = False v_rc = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Lin k("text:=.*" & v_Param1 & ".*", "index:=" & v_Param2).Exist If v_rc = False Then s_FrameworkReportError "Edit: " & v_Param1 & "Link text could not b e found! Step being skipped, but test will likely fail" Exit Sub

End If Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Link("text :=.*" & v_Param1 & ".*", "index:=" & v_Param2).Click s_FrameworkReportOutput "Completed Successfully", 2, micDone End Sub Sub s_ProcessStep_WebLinkVerifyExists Dim v_Exists ' Param1 is expected(True/False), Param2 is the Link text. Param3 is the optional index (defaults to 0) If v_Param3 = "" Then v_Param3 = "0" Else v_Param3 = (v_Param3 - 1) End If 'Preset v_Exists to false in case of runtime error where object does not exist in Object repository v_Exists = "False" v_Exists = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow) .Link("text:=.*" & v_Param2 & ".*", "index:=" & v_Param3).Exist Select Case v_Exists Case "True" Select Case v_Param1 Case "True" s_FrameworkReportOutput "Link exists", 2, micPass Case "False" s_FrameworkReportOutput "Link does not exist", 2, micFai l Case Else s_FrameworkReportError "Invalid value in Param1" End Select Case "False" Select Case v_Param1 Case "True" s_FrameworkReportOutput "Expected Link does not exist", 2, micFail Case "False" s_FrameworkReportOutput "Link does not Exist", 2, micPas s Case Else s_FrameworkReportError "Invalid value in Param1" End Select Case Else s_FrameworkReportError "Invalid Value returned by Weblink exist s check" End Select End Sub Function f_GetLastRowByVal (v_RowParam, v_ColNum) Dim v_TableRowCount, v_TableRowMax, v_MatchFound, v_KeyRowNum, v_Row, v_ Col Dim v_WebTableCurrentValue v_MatchFound = False v_Row = CStr(v_RowParam) v_Col = v_ColNum v_TableRowMax = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWi ndow).WebTable(v_FrameworkObject).GetROProperty("rows")

For v_TableRowCount = 1 To v_TableRowMax v_WebTableCurrentValue = Trim(Browser(v_FrameworkBrowserWindow).Page (v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(v_TableRowCount, v_Col)) If v_WebTableCurrentValue = Trim(v_Row) Then ' We Have a Match v_MatchFound = True v_KeyRowNum = v_TableRowCount Exit For End If Next If v_MatchFound = True Then f_GetLastRowByVal = v_KeyRowNum Else f_GetLastRowByVal = 0 ' 0 is not a valid value, and indicates that the value wasn't found End If End Function Function f_GetRecordRowByValIndex (v_RowParam, v_ColNum, v_Param3)'19/06/2007 PT Dim v_TableRowCount, v_TableRowMax, v_MatchFound, v_KeyRowNum, v_Row, v_ Col, v_index, v_counter Dim v_WebTableCurrentValue v_MatchFound = False v_Row = CStr(v_RowParam) v_Col = v_ColNum v_index = v_Param3 v_counter = 0 v_TableRowMax = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWi ndow).WebTable(v_FrameworkObject).GetROProperty("rows") For v_TableRowCount = 1 To v_TableRowMax v_WebTableCurrentValue = Trim(Browser(v_FrameworkBrowserWindow).Page (v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(v_TableRowCount, v_Col)) If v_WebTableCurrentValue = Trim(v_Row) Then 'We have found a match v_counter = v_counter + 1 If CStr(v_counter) = CStr(v_index) Then ' We Have the right number of Matches v_MatchFound = True v_KeyRowNum = v_TableRowCount Exit For End If End If Next If v_MatchFound = True Then f_GetRecordRowByValIndex = v_KeyRowNum Else f_GetRecordRowByValIndex = 0 ' 0 is not a valid value, and indicate s that the value wasn't found End If End Function

Function f_DetermineWebTableRow (v_Row) Dim v_SplitArray

v_SplitArray = Split(v_Row, "=") If UBound(v_SplitArray) = 0 Then f_DetermineWebTableRow = v_SplitArray(0) Else ' We need to parse the string, and find the appropriate Row Dim v_TableRowCount, v_TableRowMax, v_MatchFound, v_KeyRowNum v_MatchFound = False v_TableRowMax = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWi ndow).WebTable(v_FrameworkObject).GetROProperty("rows") For v_TableRowCount = 1 To v_TableRowMax v_WebTableCurrentValue = Trim(Browser(v_FrameworkBrowserWindow).Page (v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(v_TableRowCount, v_SplitArray(0))) If InStr(1,v_WebTableCurrentValue,v_SplitArray(1))>0 Then ' We Have a Match v_MatchFound = True v_KeyRowNum = v_TableRowCount Exit For End If Next If v_MatchFound = True Then f_DetermineWebTableRow = v_KeyRowNum Else f_DetermineWebTableRow = 0 ' 0 is not a valid value, and indicates that the value wasn't found End If End If End Function Function f_DetermineWebTableCol (v_Col) Dim v_SplitArray v_SplitArray = Split(v_Col, "=") If UBound(v_SplitArray) = 0 Then f_DetermineWebTableCol = v_SplitArray(0) Else ' We need to parse the string, and find the appropriate Row Dim v_TableColCount, v_TableColMax, v_MatchFound, v_KeyColNum v_MatchFound = False v_TableColMax = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWi ndow).WebTable(v_FrameworkObject).GetROProperty("cols") For v_TableColCount = 1 To v_TableColMax v_WebTableCurrentValue = Trim(Browser(v_FrameworkBrowserWindow).Page (v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(v_SplitArray(0), v_TableColCount)) If v_WebTableCurrentValue = v_SplitArray(1) Then ' We Have a Match v_MatchFound = True v_KeyColNum = v_TableColCount Exit For End If Next If v_MatchFound = True Then

f_DetermineWebTableCol = v_KeyColNum Else f_DetermineWebTableCol = 0 ' 0 is not a valid value, and indicates that the value wasn't found End If End If End Function Sub s_ProcessStep_WebWindow Dim v_ReturnString, v_WindowExists, v_HeaderValue Select Case v_FrameworkMethod Case "Back" Browser(v_FrameworkBrowserWindow).Back Case "LinkVerifyExistsByText" s_ProcessStep_WebLinkVerifyExists Exit Sub Case "LinkClickByText" s_ProcessStep_WebLinkByText Exit Sub Case "LinkClickByPartialText" s_ProcessStep_WebLinkByPartialText Exit Sub ' The following is specific for CIS Case "ClickOnCalendar" If Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Ima ge(v_Param1).Exist Then Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Im age(v_Param1).Click Else s_FrameworkReportOutput "Calendar image does not exist!", 2, mic Fail End If ' Usage: ' Usage: Case "ClickOnDate" ' Newly update 27 August 2007 VK For Payment Requires Param3 as OLP For Account Param3 Is Blank v_Date=v_Param1 ' Date v_Datelen=Len(v_Param1) v_MonthYear=v_Param2 v_temp=(Split(v_MonthYear," ")) v_Month=Replace(v_temp(0)," ","") v_Year=Replace(v_temp(1)," ","") var1 = "javascript:.*\('" vardate = v_Date&"..."&v_Month var2 = "..." varyear = v_Year var3 = "'\).*" var5 = CDate(v_Month&" "&v_Date&","&varyear)'Payment var6=var5 If (v_Datelen="1") Then ' This is done to force zero on single d igit date value var7=Split(var6,"/") var8="0"&var7(0) v_PaymentDate=var8&"\/"&var7(1)&"\/"&var7(2) Else

v_PaymentDate=Replace(var5,"/","\/")'Payment End If v_Account = var1 & vardate & var2 & varyear &var3 v_Payment = var1 &v_PaymentDate&var3 Select Case v_Param3 Case "OLP" v_ExistPayment=Browser(v_FrameworkBrowserWindow).P age(v_FrameworkPageWindow).Link("text:="&v_Date , "href:=" & v_Payment).Exist ' v_ExistPayment=Browser(v_FrameworkBrowserWindow) .Page(v_FrameworkPageWindow).Link("text:="&v_Date , "href:=" & ".*"&v_Month&".*" ).Exist If (v_ExistPayment) Then Browser(v_FrameworkBrowserWindow).Page(v_Fra meworkPageWindow).Link("text:="&v_Date , "href:=" & v_Payment).Click Else s_FrameworkReportOutput "Payment Date Link d oes not exist!", 2, micFail End If Case "" v_ExistAccount=Browser(v_FrameworkBrowserWindow).Pag e(v_FrameworkPageWindow).Link("text:="&v_Date , "href:=" & ".*"&v_Month&".*").Ex ist If (v_ExistAccount) Then ' Browser(v_FrameworkBrowserWindow).Page(v_Fr ameworkPageWindow).Link("text:="&v_Date , "href:=" & v_Payment).Click Browser(v_FrameworkBrowserWindow).Page(v_Fr ameworkPageWindow).Link("text:="&v_Date , "href:=" & ".*"&v_Month&".*").Click Else s_FrameworkReportOutput "Payment Date Link d oes not exist!", 2, micFail End If 'v_ExistAccount=Browser(v_FrameworkBrowserWindow ).Page(v_FrameworkPageWindow).Link("text:="&v_Date , "href:=" & v_Account).Exist 'If (v_ExistAccount) Then ' Browser(v_FrameworkBrowserWindow).Page(v_Fr ameworkPageWindow).Link("text:="&v_Date , "href:=" & v_Account).Click 'Else ' s_FrameworkReportOutput "Account Date Link does not exist!", 2, micFail 'End If End Select Case "VerifyCloseStaticPopUp" Dim v_text ' v_text = Browser("title:=" & v_FrameworkBrowserWindow).Dialog("text :=" & v_FrameworkPageWindow).Static("x:=65").GetROProperty("text") v_text =Dialog("text:=" & v_FrameworkPageWindow).Static("x:=65").Get ROProperty("text") If InStr(Trim(v_Param1),Trim(v_text))>0 Then

'

Browser("title:=" & v_FrameworkBrowserWindow).Dialog("text:=" & v_FrameworkPageWindow).WinButton("text:=OK").Click s_FrameworkReportOutput "Dialog Value exist!", 2, micPass Else s_FrameworkReportOutput "Dialog does not exist!", 2, micFail End If If (v_Param2="OK") Then ' Dialog("text:=" & v_FrameworkPageWindow).WinButton("text:=OK").Clic k Browser("title:=" & v_FrameworkBrowserWindow).Dialog("text:=" & v_Fr ameworkPageWindow).WinButton("text:=OK").Click Else Dialog("text:=" & v_FrameworkPageWindow).Close End If Case "VerifyDateIsEnabled" Dim v_IsEnabled v_IsEnabled = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPage Window).Link("text:=" & v_Param1).Exist If v_IsEnabled = "True" Then s_FrameworkReportOutput "Link exists", 2, micPass Else s_FrameworkReportOutput "Link does not exist!", 2, micFail End If Case "VerifyCancelStaticPopUp" 'PT 28/06/07 - This method is slightly dif ferent from above - it clicks on cancel instead of OK Dim v_text1 v_text1 = Dialog("text:=" & v_FrameworkPageWindow).Static("x:=65").G etROProperty("text") If Trim(v_text1)= Trim(v_Param1) Then Dialog("text:=" & v_FrameworkPageWindow).Close End If Case "VerifyCloseStaticDailog" 'PT 28/06/07 - This method is slightly dif ferent from above - it clicks on cancel instead of OK Dialog("text:="&v_FrameworkPageWindow).Close Case "UnTickCheckBoxBasedOnIndex" added PT - 03/07/07 Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).WebChe ckBox("index:=" & v_Param1).Set "OFF" Case "TickCheckBoxBasedOnVal" 'added PT - 20/06/07 Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).WebChe ckBox("value:=" & v_Param1).Set "ON" Case "UnTickCheckBoxBasedOnVal" 'added PT - 23/06/07 Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).WebChe ckBox("value:=" & v_Param1).Set "OFF" Case "KillWindow" Browser(v_FrameworkBrowserWindow).Close Case "KillWindowDialog" ' Vk 26/07/07 Browser(v_FrameworkBrowserWindow).Dialog(v_FrameworkPageWindow).Clos

e Case "TickCheckBoxBasedOnIndex" 'PT 27/06/07 Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).WebChe ckBox("index:=" & v_Param1).Set "ON" Case "GetIndexBasedOnRow" 'Param1 is the row number of the record where you want to select the radio button 'Param2 is the number of rows above the rows where the radio buttons appear 'Param3 is the index number of the radio button you want to select 'The -1 was added because radio button indexes start at 0 not 1. DataTable("Param3", v_SheetName) = "#" & (v_Param1 - v_Param2)-1 Case "ModalClick" ' This method is really a Window Click, but the CIS implementation of th e Framework doesn't distinguish between a Web Window (Browser) and a Windows nat ive Window s_ProcessStep_WindowClick Case "ModalResize" ' This method is really a Window Click, but the CIS implementation of th e Framework doesn't distinguish between a Web Window (Browser) and a Windows nat ive Window s_ProcessStep_WindowResize Case "VerifyExists" 'Preset v_WindowExists to false in case of runtime error where objec t does not exist in Object repository v_WindowExists = False v_WindowExists = Browser(v_FrameworkBrowserWindow).Exist(0) Select Case v_WindowExists Case "True" Select Case v_Param1 Case "True" s_FrameworkReportOutput "Expected Window exists", 2, micPass Case "False" s_FrameworkReportOutput "Unexpected Window exists", 2, micFail Case Else s_FrameworkReportError "Unknown result from Window Exists Method" End Select Case "False" Select Case v_Param1 Case "True" s_FrameworkReportOutput "Expected Window does not ex ist", 2, micFail Case "False" s_FrameworkReportOutput "Window does not exist", 2, micPass Case Else s_FrameworkReportError "Unknown result from Window Exists Method" End Select Case Else s_FrameworkReportError "Unknown Param attempted against Win dow Object" End Select Exit Sub

Case Else s_FrameworkReportError "Unknown method attempted against Window/Bro wser: " & v_FrameworkMethod Exit Sub End Select s_FrameworkReportOutput "Completed Successfully", 2, micDone End Sub ' Non Web (ie Window) Functions Sub s_ProcessStep_WindowClick ' Param1 is the Link text. Param2 is the optional index (defaults to 0) 'Preset v_rc to false in case of runtime error where object does not exi st in Object repository v_rc = False ' Check that Window exists v_rc = Window(v_FrameworkBrowserWindow).Dialog(v_FrameworkPageWindow).Ex ist If v_rc = False Then s_FrameworkReportError "Window: " & Window(v_FrameworkBrowserWindow ) & " could not be found! Step being skipped, but test will likely fail" Exit Sub End If ' The following is done for CIS specifically: Window(v_FrameworkBrowserWindow).Resize 1000, 700 Window(v_FrameworkBrowserWindow).Click v_Param1, v_Param2 End Sub Sub s_ProcessStep_WindowResize ' Param1 is the Link text. Param2 is the optional index (defaults to 0) 'Preset v_rc to false in case of runtime error where object does not exi st in Object repository v_rc = False ' Check that Window exists v_rc = Window(v_FrameworkBrowserWindow).Exist If v_rc = False Then s_FrameworkReportError "Window: " & Window(v_FrameworkBrowserWindow ) & " could not be found! Step being skipped, but test will likely fail" Exit Sub End If Window(v_FrameworkBrowserWindow).Resize v_Param1, v_Param2 End Sub Sub s_ProcessStep_WebElement 'Preset v_rc to false in case of runtime error where object does not exist in Object repository v_rc = False ' Check that WebElement exists v_rc = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow) .WebElement(v_FrameworkObject).Exist If v_rc = False Then s_FrameworkReportError "WebElement: " & v_FrameworkObject & "Co uld not be found! Step being skipped, but test will likely fail" Exit Sub End If Select Case v_FrameworkMethod Case "Click"

Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).WebElement(v_FrameworkObject).Click Case "Get" DataTable("Param1", v_SheetName) = Browser(v_FrameworkBrowse rWindow).Page(v_FrameworkPageWindow).WebElement(v_FrameworkObject).GetROProperty ("innertext") Case "Verify" Dim v_WebElementValue v_WebElementValue= Trim(Browser(v_FrameworkBrowserWindow).Pa ge(v_FrameworkPageWindow).WebElement(v_FrameworkObject).GetROProperty("innertext ")) v_Param=UCase(Replace(v_Param1," ","")) v_Element=UCase(Replace(v_WebElementValue," ","")) If InStr(v_Element,v_Param)>0 Then s_FrameworkReportOutput "WebElement Value is Correct (" & v_WebElementValue & ")", 2, micPass Else s_FrameworkReportOutput "WebElement is incorrect, '" & v _WebElementValue & "' instead of: '"+ V_Param1 + "'", 2, micFail End If Exit Sub Case "VerifyProperty" Dim v_PropertyValue v_PropertyValue = Browser(v_FrameworkBrowserWindow).Page(v_F rameworkPageWindow).WebElement(v_FrameworkObject).GetROProperty(v_Param1) If CStr(v_PropertyValue) = CStr(v_Param2) Then s_FrameworkReportOutput "Edit Property Value is Correct (" & v_PropertyValue & ")", 2, micPass Else s_FrameworkReportOutput "Edit Property Value is incorrec t, '" & v_PropertyValue & "' instead of: '" & v_Param2 & "'", 2, micFail End If Exit Sub Case Else s_FrameworkReportError "This Method is not Built" Exit Sub End Select ' If the Code gets here, we have completed without error. Report thi s to the log s_FrameworkReportOutput "Completed Successfully", 2, micDone End Sub Sub s_ProcessStep_WebTable ' On Error Resume Next Dim v_ReturnString, vWindowExists, v_WebTableExists Dim v_RowNum, v_ColNum

'Preset v_rc to false in case of runtime error where object does not exist i n Object repository v_rc = False ' Unless this is a VerifyExists method, Check that WebTable exists If v_FrameworkMethod <> "VerifyExists" Then v_rc = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Web Table(v_FrameworkObject).Exist If v_rc = False Then s_FrameworkReportError "Web Table: " & v_FrameworkObject & "Could n ot be found! Step being skipped, but test will likely fail"

Exit Sub End If End If Select Case v_FrameworkMethod Case "LinkScrollSearch" ' This Script searches for a Link in webtable in all pages and click's o n the Link ' This Scripts Click on Link Item in v_Param1 'v_Param1=Primary Key ( Value to be Clicked on); 'v_Param2= "Next Page" Link Name eg "Next.*accounts" 'v_Param3=Secoundary Unique Key (Optional) if Another Key is to be used to search for unique record 'v_Param4= Index of v_param2 (By default 0) 'v_Param5=True/False ' If Failed - it reports as passed Dim v_FirstInputParam,v_FirstSecoundParam v_FirstInputParam=UCase(Replace(v_Param1," ","")) v_FirstSecoundParam=UCase(Replace(v_Param3," ","")) v_FlagSecond="Nil" v_FlagFirst="Nil" v_Row=Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPage Window).WebTable(v_FrameworkObject).RowCount ' Locate the description Column Do For i=1 To v_Row ' v_ColumnCell=Browser(v_FrameworkBrowserWind ow).Page(v_FrameworkPageWindow).WebTable(v_FrameworkObject).ColumnCount(i) ' v_ColumnCell=v_ColumnCell+1 ' Indicated Number of Columns For j=1 To 10 'Restricting the Column to max of 7 reporter.ReportEvent micdone,"The Row :" &i &" The Column is "& j,"" v_FirstKeyCell = Browser(v_FrameworkBrowserW indow).Page(v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(i,j) v_FirstKeyCellNoSpaces=UCase(Replace(v_First KeyCell," ","")) If (v_FirstKeyCellNoSpaces <> "ERROR :THESPECIFIEDCELLDOESNOTEXIST.") And (v_FirstKeyCellNoSpaces<> "" ) Then If (v_FirstKeyCellNoSp aces=v_FirstInputParam) Then v_FlagFirst ="FirstKeyFound" v_Row=i v_Column=j If (v_Param3 <> "") Then For M=1 To 10 ' Max of 6 column Exist v_SecoundKeyCell = Browser(v_FrameworkBrowserWindow).Page(v_Framewor kPageWindow).WebTable(v_FrameworkObject).GetCellData(v_Row,M) v_SecoundKeyCellNoSpaces=UCase(Replace(v_SecoundKeyCell," ",""))

If (v_SecoundKeyCellNoSpaces <> "ERROR:THESPECIFIEDCELLDOESNOTEXIST .") And (v_SecoundKeyCellNoSpaces<> "" ) Then If (v_SecoundKeyCellNoSpaces=v_FirstSecoundParam) Then v_FlagSecond="SecondKeyFound" Set v_LinkObj=Browser(v_FrameworkBrowserWindow).Page(v_F rameworkPageWindow).WebTable(v_FrameworkObject).ChildItem( v_Row, v_Column, "Lin k", 0) v_LinkObj.click s_FrameworkReportOutput "Combination Key Found ::::::::: : Clicking on Link SuccessFul :"&v_Param1, 2, micPass Exit Do End If End If Next Else If ( v_FlagFirst="FirstKeyFound") Then ' s_FrameworkReportOutput "Combination Key Found : Clicking on Link: "&v_Param1, 2, micPass Set v_LinkObj=Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPag eWindow).WebTable(v_FrameworkObject).ChildItem( v_Row, v_Column, "Link", 0) v_LinkObj.click s_FrameworkReportOutput "Single Unique KeyUsed ::::::"&v_Param1 "******Click Successfull******" , 2, MicPass Exit Do End If End If ' End If for v_Param3 Loop End If ' End If End If' End If for Having spaces fo r First Key Cell Next Next If v_Param4 ="" Then v_Index="0" Else v_Index=v_Param4 End If If v_Param5 ="" Then ' Reporting Purposes for Failed Link v_Param5="False" End If &

If v_Param2 <>"" Then On Error Resume Next v_LinkExists = Brows er(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Link("text:=.*" & v_Par am2 & ".*", "index:=" & v_Index).Exist(0) If ( v_LinkExists="F alse") Then If ( v_FlagFirst<>"FirstKeyFound" ) Or (v_FlagSecond<>"SecondKeyFound" )Then Sel ect Case v_Param5 ' This is only for Reporting Purposes Case "True" s_FrameworkReportOutput "Link Object Disabled & Input Link Entered Not Fo und :"& v_Param1 , 2, MicPass Case "False" s_FrameworkReportOutput "Link Object Disabled & Input Link Entered Not F ound :"& v_Param1 , 2, MicFail End Select Ex it Do End I f Else Browser(v_Fr ameworkBrowserWindow).Page(v_FrameworkPageWindow).Link("text:=.*" & v_Param2 & " .*", "index:=" & v_Index).Click End If End If Loop Until ( v_LinkExists="False") ' s_Refresh ' refresh page function Case "VerifyRowIndicator" 'Author Annie Thomas 25-Mar-2008 'This method checks whether a particular row in a webtable has a asterisk in dicator or error indicator 'v_Param1=Name of the Field 'v_Param2=Column of indicator 'v_Param3=Indicator property 'v_Param4=Property value On Error Resume Next 'initialise variables v_ReadyState=True v_MatchFound=False Dim v_IndicatorPropValue,v_IndicatorPropValueNew,v_Param4New 'check if parameter 1 and 2 are present. mandatory input. If v_Param1="" Or v_Param2="" Or v_Param3="" Or v_Param4="" Then v_ReadyState=False Reporter.ReportEvent micFail, 1,"Invalid input parameter. Please check if input parameters are specified" End If

'search for required row If v_ReadyState Then v_FirstInputParam=UCase(Replace(v_Param1,"-","")) v_FirstInputParam=UCase(Replace(v_FirstInputParam," ","")) 'get number of rows in webtable v_MaxRow=Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).WebTa ble(v_FrameworkObject).RowCount For i=1 To v_MaxRow 'iterate through all the columns in the table for a row. a maximum of 10 col umns are checked. For j=1 To 10' Restricting to Maximum of 10 column 'get the cell data and compare with parameter1 v_FirstKeyCell = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkP ageWindow).WebTable(v_FrameworkObject).GetCellData(i,j) v_FirstKeyCellNoSpaces=UCase(Replace(v_FirstKeyCell,"-","")) v_FirstKeyCellNoSpaces=UCase(Replace(v_FirstKeyCellNoSpaces," ","")) If (v_FirstKeyCellNoSpaces <> "ERROR:THESPECIFIEDCELLDOESNOTEXIST.") And (v_FirstKeyCellNoSpaces<> "" ) Then If InStr(1,v_FirstKeyCellNoSpaces,v_FirstInputParam) >0 Then v_Report = "Identified cell " & Chr(34) & i & ":" & j & " in Web Table " & Chr(34) & v_FrameworkObject & Chr(34) & " containing cell data " & Chr (34) & v_param1 & Chr(34) s_FrameworkReportOutput v_Report , 2, micDone Set v_IndicatorObject=Browser(v_FrameworkBrowserWindow).Page (v_FrameworkPageWindow).WebTable(v_FrameworkObject).ChildItem(i,v_Param2,"Image" ,0) v_IndicatorPropValue=v_IndicatorObject.GetROProperty(v_Param 3) If Err.Number <> 0 Then Err.Clear End If v_IndicatorPropValueNew=UCase(Replace(v_IndicatorPropValue," ","")) v_Param4New=UCase(Replace(v_Param4," ","")) If (v_IndicatorPropValueNew=v_Param4New) Then v_MatchFound=True Exit For End If End If End If Next If v_MatchFound Then Exit For End If Next End If If v_MatchFound Then v_Report = "Identified row in WebTable " & Chr(34) & v_FrameworkObject & Chr(34) & " containing cell data " & Chr(34) & v_param1 & Chr(34) & " and indica tor " & Chr(34) & v_Param4& Chr(34) s_FrameworkReportOutput v_Report , 2, micPass Else v_Report = "Failed to Identify row in WebTable " & Chr(34) & v_FrameworkO bject & Chr(34) & " containing cell data " & Chr(34) & v_param1 & Chr(34) & " an

d indicator " & Chr(34) & v_param4 & Chr(34) s_FrameworkReportOutput v_Report , 2, micFail End If

Case "VerifyByNameReport" ' Created by vivek 25 Oct 2007 ' Same as VerifyByName expert for Param3 is used for Report found and not found ' This Method Checks if the value exists between start (v_Param1) &(v_Param2)co nstraint in the webtable. I 'v_Param1=Name of the Field (Starting Value); 'v_Param2=Value of the Field 'v_Param3=Status ( True/False) - If not found & param3 is True It return a Pass for failed condition 'v_Param4= Next Page Link Name eg. Link 20Account 'v_Param5= Index of the Link ( If needed) 'v_Param6= True in case none of the value exist and want to report a tru e condition only then this is used v_FirstInputParam=UCase(Replace(v_Param1," ","")) v_SecoundInputParam=UCase(Replace(v_Param2," ","")) v_ThirdInputParam=UCase(Replace(v_Param3," ","")) v_Flag="Nil" v_LinkExists="True" ' This Flag to check for link atleast once before it exi ts the Loop v_Row=Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Web Table(v_FrameworkObject).RowCount ' Locate the description Column Do For i=1 To v_Row v_ColumnCell=Browser(v_FrameworkBrowserWindo w).Page(v_FrameworkPageWindow).WebTable(v_FrameworkObject).ColumnCount(i) For j=1 To 10 ' Restricting to Maximum of 7 column v_FirstKeyCell = Browser(v_FrameworkBrowserW indow).Page(v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(i,j) v_FirstKeyCellNoSpaces0=UCase(Replace(v_Firs tKeyCell,"-","")) v_FirstKeyCellNoSpaces=UCase(Replace(v_First KeyCellNoSpaces0," ","")) If (v_FirstKeyCellNoSpaces <> "ERROR :THESPECIFIEDCELLDOESNOTEXIST.") And (v_FirstKeyCellNoSpaces<> "" ) Then If (v_FirstKeyCellNoSp aces=v_FirstInputParam) Then v_Flag="Fir stKeyFound" v_Row=i v_Column=j v_ThirdFlag =(10- v_Column) ' Should do from the found Column to End Column only i.e limite d to 6 column If (v_Param2 <> "") Then For M=v_Column To 10' Max of 6 column Exist v_SecoundKeyCell = Browser(v_FrameworkBrowserWindow).Page(v_Framewor

kPageWindow).WebTable(v_FrameworkObject).GetCellData(v_Row,M) v_SecoundKeyCellNoSpaces0=UCase(Replace(v_SecoundKeyCell,"-","")) v_SecoundKeyCellNoSpaces=UCase(Replace(v_SecoundKeyCellNoSpaces0," ","")) If (v_SecoundKeyCellNoSpaces <> "ERROR:THESPECIFIEDCELLDOESNOTEXIST .") And (v_SecoundKeyCellNoSpaces<> "" ) Then If (v_SecoundKeyCellNoSpaces=v_SecoundInputParam) Then v_Flag="SecondKeyFound" ' s_FrameworkReportOutput "Both Entered Field Exist !!!!! Param1:"&v_Param1& vbnewline &"Param2:"&v_Param2 , 2, micPass Exit Do ElseIf (v_SecoundKeyCellNoSpaces=v_ThirdInputParam) And (v_ ThirdInputParam <> "" ) And (v_LinkExists="False")Then v_Flag="ThirdKeyConstraintFound" s Not Exist !!!!! l 's_FrameworkReportOutput "Input Field Value Doe Param1:"&v_Param1& vbnewline &"Param2:"&v_Param2 , 2, micFai Exit Do End If End If Next Else If v_Param2="" Then s_FrameworkReportOutput "Requires Param2!!!!!! Please Enter Param2!!!!!" , 2, micFail Exit Do End If End If ' End If for v_Param3 Loop End If ' End If End If' End If for Having spaces fo r First Key Cell Next Next If v_Param5 ="" Then v_Index="0" Else v_Index=v_Param5 End If Only Param1 Exist!!!!!

v_LinkExists = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).L ink("text:=.*" & v_Param4 & ".*", "index:=" & v_Index).Exist(0) If (v_Param4 <>"") And (v_LinkExists="True") And (( v_Flag <>"FirstKeyFound " ) Or (v_Flag<>"SecondKeyFound" )) Then Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Link("text :=.*" & v_Param4 & ".*", "index:=" & v_Index).Click Else If ( v_Flag ="FirstKeyFound" ) Then v_Flag ="FirstKeyFound" Exit Do Else v_Flag="None" ' Nothing is Found in Entire Table Exit Do End If End If Loop Until ( v_LinkExists="False") Select Case v_Flag Case "FirstKeyFound" If (v_Param2 <>"") Then 'Reporter.ReportEvent MicFail,"Invalid Data Entry Param2 !!! !!!!!!! Only First Key !!!","" ' Debug Purposes s_FrameworkReportOutput " Invalid Input Param2 Exist !!!!! Only First Param1 Exist - Param1:"&v_Param1& vbNewLine &"Param2:"&v_Param2 , 2, mi cFail End If Case "SecondKeyFound" ' Reporter.ReportEvent MicPass,"Both Element Exit","" ' Debug P urposes s_FrameworkReportOutput "Both Entered Param Field Exist !!!!! Param1:"&v_Param1& vbNewLine &"Param2:"&v_Param2 , 2, micPass Case "ThirdKeyConstraintFound" s_FrameworkReportOutput "Input Field Value Does Not Exist !!!!! Param1:"&v_Param1& vbNewLine &"Param2:"&v_Param2 , 2, micFail 'Reporter.ReportEvent MicFail,"Invalid Param2: "&v_Param2,"" ' Debug Purposes Case "None" If v_Param3="True" Then s_FrameworkReportOutput "Input Param1 Field Value Does Not Exi st !!!!! Param1:"&v_Param1& vbNewLine &"Param2:"&v_Param2 , 2, micPass 'Reporter.ReportEvent MicFail,"First Input Param1 Not Found !!! ","" ' Debug Purposes Else s_FrameworkReportOutput "Input Param1 Field Value Does Not Exi st !!!!! Param1:"&v_Param1& vbNewLine &"Param2:"&v_Param2 , 2, micFail End If End Select ' s_Refresh ' refresh page function Case "VerifySelectRadioCheckBox" 'This Method selects a row if v_Param1 and v_Param2 are displayed in the ro

w. 'v_Param1=Value of a field in a row 'v_Param2= Optional. Value of a field in a row. v_Param 2 should appear afte r v_Param1 'v_Param3= Optional. Row selection object type. Row selection can be through a radio button or check box. Radio button is used by default.(RADIOBUTTON/CHECK BOX/VERIFY/LINK) 'v_Param4= Next Page Link Name eg. Link 20Account 'v_Param5= Output the row of the found element ' used by some other scripts Dim v_SelectObject v_ReadyState=True v_SecondInputParamAbsent = False v_ActiveLink=True ' This Flag to check for link atleast once before it exits the Loop v_MatchFound=False 'check if parameter 1 and 4 are present. mandatory input. If v_Param1="" OR v_Param4="" Then v_ReadyState=False 's_FrameworkReportOutput "Invalid input parameter. Please check if para meter1/parameter3 is specified" , 2, micFail Reporter.ReportEvent micFail, 1,"Invalid input parameter. Please check if parameter1/parameter4 is specified" End If 'check if parameter2 is specified If v_Param2="" Then v_SecondInputParamAbsent=True End If 'search for required row If v_ReadyState Then 'remove special character '-' and spaces v_FirstInputParam=UCase(Replace(v_Param1,"-","")) v_FirstInputParam=UCase(Replace(v_FirstInputParam," ","")) If Not v_SecondInputParamAbsent Then 'remove special character '-' and spaces v_SecondInputParam=UCase(Replace(v_Param2,"-","")) v_SecondInputParam=UCase(Replace(v_SecondInputParam," ","")) End If 'get number of rows in webtable 'v_MaxRow=Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow). WebTable(v_FrameworkObject).RowCount Do 'get number of rows in webtable v_MaxRow=Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindo w).WebTable(v_FrameworkObject).RowCount v_RadioGroupIndex=-1 'iterate through all the rows in the webtable For i=1 To v_MaxRow v_RadioGroupCount=Browser(v_FrameworkBrowserWindow).Page(v_Frame workPageWindow).WebTable(v_FrameworkObject).ChildItemCount( i, 1, "WebRadioGroup ") If v_RadioGroupCount>0 Then

v_RadioGroupIndex=v_RadioGroupIndex+1 End If 'iterate through all the columns in the table for a row. a m aximum of 10 columns are checked. For j=1 To 10' Restricting to Maximum of 10 column 'get the cell data and compare with parameter1 v_FirstKeyCell = Browser(v_FrameworkBrowserWindow).Page( v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(i,j) v_FirstKeyCellNoSpaces=UCase(Replace(v_FirstKeyCell,"-", "")) v_FirstKeyCellNoSpaces=UCase(Replace(v_FirstKeyCellNoSpa ces," ","")) If (v_FirstKeyCellNoSpaces <> "ERROR:THESPECIFIEDCELLDO ESNOTEXIST.") And (v_FirstKeyCellNoSpaces<> "" ) Then If (v_FirstKeyCellNoSpaces=v_FirstInputParam) Then v_Row=i v_Column=j 'If second parameter need not be checked, report successful match If v_SecondInputParamAbsent Then v_MatchFound=True DataTable.Value("Param5", v_SheetName)= v_Ro w ' used by 11_BASE_OGA_Export_01B scripts ''VK Exit Do 'if second parameter needs to be checked, iterat e through all the remaining columns for the row Else For M=v_Column+1 To 10' Max of 6 column Exis t 'get cell data and compare with paramete r2 v_SecondKeyCell = Browser(v_FrameworkBro wserWindow).Page(v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData( v_Row,M) v_SecondKeyCellNoSpaces=UCase(Replace(v_ SecondKeyCell,"-","")) v_SecondKeyCellNoSpaces=UCase(Replace(v_ SecondKeyCellNoSpaces," ","")) If (v_SecondKeyCellNoSpaces <> "ERROR:TH ESPECIFIEDCELLDOESNOTEXIST.") And (v_SecondKeyCellNoSpaces<> "" ) Then If (v_SecondKeyCellNoSpaces=v_Second InputParam) Then v_MatchFound=True v_ColumnValue=M Exit Do End If End If Next End If End If End If Next Next 'check whether the link to search in further pages of the webtab le is active v_ActiveLink = Browser(v_FrameworkBrowserWindow).Page(v_Framewor kPageWindow).Link("text:=.*" & v_Param4 & ".*","index:=0").Exist(0) 'Index?? 'if link is active and match not found, click the link and conti nue search on new rows 'if link is inactive and match not found, report failure

If v_ActiveLink And (Not v_MatchFound) Then Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow ).Link("text:=.*" & v_Param4 & ".*","index:=0").Click End If Loop While v_ActiveLink ' If v_MatchFound Then v_Report = "Identified row in WebTable " & Chr(34) & v_Framework Object & Chr(34) & " containing cell data " & Chr(34) & v_param1 & Chr(34) If Not v_SecondInputParamAbsent Then v_Report = v_Report & " and " & Chr(34) & v_param2 & Chr(34) End If s_FrameworkReportOutput v_Report , 2, micPass 'Reporter.ReportEvent micPassl, 1,v_Report If v_Param3="" OR Ucase(Trim(v_Param3))="RADIOBUTTON" Then Set v_SelectObject=Browser(v_FrameworkBrowserWindow).Page(v_ FrameworkPageWindow).WebTable(v_FrameworkObject).ChildItem( v_Row, 1, "WebRadioG roup", 0) v_SelectObject.Select "#" & v_RadioGroupIndex ElseIf v_Param3 <> "" And UCase(Trim(v_Param3))="CHECKBOX" T hen Set v_SelectObject=Browser(v_FrameworkBrowserWindow).Page(v_ FrameworkPageWindow).WebTable(v_FrameworkObject).ChildItem( v_Row, 1, "WebCheckB ox", 0) v_SelectObject.Set "ON" ElseIf v_Param3 <> "" And UCase(Trim(v_Param3))="LINK" Then Set v_SelectObject=Browser(v_FrameworkBrowserWindow).Page(v_ FrameworkPageWindow).WebTable(v_FrameworkObject).ChildItem( v_Row, v_ColumnValue , "Link", 0) v_SelectObject.Click End If ''NEED TO ADD FUNCTIONS TO CHECK WHETHER ROW SELECTED AND REPORT BELOW.... NEED THE CURRENT FUNCTION LIB FUNCTIONS v_Report="Row Selected" s_FrameworkReportOutput v_Report , 2, micPass 'Reporter.ReportEvent micPass, 1,"Row Selected" Else v_Report = "Failed to Identify row in WebTable " & Chr(34) & v_F rameworkObject & Chr(34) & " containing cell data " & Chr(34) & v_param1 & Chr(3 4) If Not v_SecondInputParamAbsent Then v_Report = v_Report & " and " & Chr(34) & v_param2 & Chr(34) End If s_FrameworkReportOutput v_Report , 2, micFail 'Reporter.ReportEvent micFail, 1,v_Report End If End If Case "VerifyByName" 'Created by Annie 10 Dec 2007 'v_Param1=Name of the Field (Starting Value); 'v_Param2=Value of the Field 'v_Param3=Ending value (constraint Value , Optional) 'v_Param4= Next Page Link Name eg. Link 20Account 'v_Param5= Index of the Link ( If needed) 'initialise variables v_ConstraintValue=False v_ConstraintFailure=False v_ReadyState=True v_ActiveLink=True ' This Flag to check for link atleast once before it e

xits the Loop v_MatchFound=False 'check if parameter 1 and 2 are present. mandatory input. If v_Param1="" OR v_Param2="" Then v_ReadyState=False Reporter.ReportEvent micFail, 1,"Invalid input parameter. Please che ck if input parameter1/parameter2 is specified" End If 'check if parameter 4 is present. optional input. If v_Param4="" Then v_ActiveLink=False End If 'check if parameter2 is specified If v_Param3<>"" Then v_ConstraintValue=True End If 'search for required row If v_ReadyState Then v_FirstInputParam=UCase(Replace(v_Param1,"-","")) v_FirstInputParam=UCase(Replace(v_FirstInputParam," ","")) v_SecondInputParam=UCase(Replace(v_Param2,"-","")) v_SecondInputParam=UCase(Replace(v_SecondInputParam," ","")) If v_ConstraintValue Then v_ThirdInputParam=UCase(Replace(v_Param3," ","")) v_ThirdInputParam=UCase(Replace(v_ThirdInputParam," ","")) End If Do 'get number of rows in webtable v_MaxRow=Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageW indow).WebTable(v_FrameworkObject).RowCount For i=1 To v_MaxRow 'iterate through all the columns in the table for a row. a maxim um of 10 columns are checked. For j=1 To 10' Restricting to Maximum of 10 column 'get the cell data and compare with parameter1 v_FirstKeyCell = Browser(v_FrameworkBrowserWindow).Page(v_Fr ameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(i,j) v_FirstKeyCellNoSpaces=UCase(Replace(v_FirstKeyCell,"-","")) v_FirstKeyCellNoSpaces=UCase(Replace(v_FirstKeyCellNoSpaces, " ","")) If (v_FirstKeyCellNoSpaces <> "ERROR:THESPECIFIEDCELLDOESNOT EXIST.") And (v_FirstKeyCellNoSpaces<> "" ) Then If Instr(1,v_FirstKeyCellNoSpaces,v_FirstInputParam) >0 Then v_Row=i v_Column=j 'iterate through all the remaining columns for the r ow For M=v_Column To 10 v_ConstraintFailure=False 'get cell data for comparison v_SecondKeyCell = Browser(v_FrameworkBrowserWin

dow).Page(v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(v_Row,M ) v_SecondKeyCellNoSpaces=UCase(Replace(v_SecondK eyCell,"-","")) v_SecondKeyCellNoSpaces=UCase(Replace(v_SecondK eyCellNoSpaces," ","")) If (v_SecondKeyCellNoSpaces <> "ERROR:THESPECIF IEDCELLDOESNOTEXIST.") And (v_SecondKeyCellNoSpaces<> "" ) Then 'if there is a constraint specified, check if we have reached the constraint value 'exit loop if constraint found If v_ConstraintValue Then If ( v_SecondKeyCellNoSpaces=v_ThirdIn putParam) Then v_ConstraintFailure=True Exit For End If End If 'check for second parameter If Instr(1,v_SecondKeyCellNoSpaces,v_SecondI nputParam)>0 Then v_MatchFound=True v_ColumnValue=M Exit Do End If End If Next End If End If Next Next If v_Param4<>"" Then 'check whether the link to search in further pages of the we btable is active v_ActiveLink = Browser(v_FrameworkBrowserWindow).Page(v_Fram eworkPageWindow).Link("text:=.*" & v_Param4 & ".*","index:=0").Exist(0) 'Index? ? 'if link is active and match not found, click the link and c ontinue search on new rows 'if link is inactive and match not found, report failure If v_ActiveLink And (Not v_MatchFound) Then Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWi ndow).Link("text:=.*" & v_Param4 & ".*","index:=0").Click End If End If Loop While v_ActiveLink ' If v_MatchFound Then v_Report = "Identified row in WebTable " & Chr(34) & v_Framework Object & Chr(34) & " containing cell data " & Chr(34) & v_param1 & Chr(34) & " a nd " & Chr(34) & v_param2 & Chr(34) If v_ConstraintValue Then v_Report = v_Report & " and within the constraint value " & Chr(34) & v_param3 & Chr(34) End If s_FrameworkReportOutput v_Report , 2, micPass 'Reporter.ReportEvent micPassl, 1,v_Report Else v_Report = "Failed to Identify row in WebTable " & Chr(34) & v_F rameworkObject & Chr(34) & " containing cell data " & Chr(34) & v_param1 & Chr(3

4) & " and " & Chr(34) & v_param2 & Chr(34) If v_ConstraintValue Then v_Report = v_Report & " and within the constraint value " & Chr(34) & v_param3 & Chr(34) End If s_FrameworkReportOutput v_Report , 2, micFail 'Reporter.ReportEvent micFail, 1,v_Report End If End If Case "VerifyByNameOld" ' Created by vivek 25 Oct 2007 ' This Method Checks if the value exists between start (v_Param1) and end (v_Pa ram3)constraint in the webtable. I 'v_Param1=Name of the Field (Starting Value); 'v_Param2=Value of the Field 'v_Param3=Ending value (constraint Value , Optional) 'v_Param4= Next Page Link Name eg. Link 20Account 'v_Param5= Index of the Link ( If needed) v_FirstInputParam0=UCase(Replace(v_Param1,"-","")) v_FirstInputParam=UCase(Replace(v_FirstInputParam0," ","")) v_SecoundInputParam0=UCase(Replace(v_Param2,"-","")) v_SecoundInputParam=UCase(Replace(v_SecoundInputParam0," ","")) v_ThirdInputParam0=UCase(Replace(v_Param3," ","")) v_ThirdInputParam=UCase(Replace(v_ThirdInputParam0," ","")) v_found="No" v_Flag="Nil" v_LinkExists="False" ' This Flag to check for link atleast once before it ex its the Loop v_Row=Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Web Table(v_FrameworkObject).RowCount ' Locate the description Column Do For i=1 To v_Row If (v_found="Yes") Then Exit For End If v_ColumnCell=Browser(v_FrameworkBrowserWindow).Page(v_FrameworkP ageWindow).WebTable(v_FrameworkObject).ColumnCount(i) For j=1 To 10' Restricting to Maximum of 7 column If (v_found="Yes") Then ' Exit do is Locking webtable so replaced Exit do with exit For Exit For End If v_FirstKeyCell = Browser(v_FrameworkBrowserW indow).Page(v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(i,j) v_FirstKeyCellNoSpaces0=UCase(Replace(v_Firs tKeyCell,"-",""))

v_FirstKeyCellNoSpaces=UCase(Replace(v_First KeyCellNoSpaces0," ","")) If (v_FirstKeyCellNoSpaces <> "ERROR :THESPECIFIEDCELLDOESNOTEXIST.") And (v_FirstKeyCellNoSpaces<> "" ) Then If (v_FirstKeyCellNoSp aces=v_FirstInputParam) Then v_Flag="Fir stKeyFound" v_Row=i v_Column=j v_ThirdFlag= (10- v_Column) ' Should do from the found Column to End Column only i.e limited to 6 column If (v_Param2 <> "") Then For M=v_Column To 10' Max of 6 column Exist v_SecoundKeyCell = Browser(v_FrameworkBrowserWindow).Page(v_Framewor kPageWindow).WebTable(v_FrameworkObject).GetCellData(v_Row,M) v_SecoundKeyCellNoSpaces0=UCase(Replace(v_SecoundKeyCell,"-","")) v_SecoundKeyCellNoSpaces=UCase(Replace(v_SecoundKeyCellNoSpaces0," ","")) If (v_SecoundKeyCellNoSpaces <> "ERROR:THESPECIFIEDCELLDOESNOTEXIST .") And (v_SecoundKeyCellNoSpaces<> "" ) Then If (v_SecoundKeyCellNoSpaces=v_SecoundInputParam) Then v_Flag="SecondKeyFound" v_found="Yes" Exit For

ElseIf (v_SecoundKeyCellNoSpaces=v_ThirdInputParam) And (v_ ThirdInputParam <> "" ) And (v_LinkExists="False")Then v_Flag="ThirdKeyConstraintFound" v_found="Yes" Exit Do End If End If Next Else If v_Param2="" Then s_FrameworkReportOutput "Requires Param2!!!!!! Only Param1 Exist!!!!!

Please Enter Param2!!!!!" , 2, micFail Exit Do End If End If ' End If for v_Param3 Loop End If ' End If End If' End If for Having spaces fo r First Key Cell Next Next If v_Param5 ="" Then v_Index="0" Else v_Index=v_Param5 End If If (v_found <>"Yes") Then v_LinkExists = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPage Window).Link("text:=.*" & v_Param4 & ".*", "index:=" & v_Index).Exist(0) End If If (v_Param4 <>"") And (v_found <>"Yes") AND (v_LinkExists="True") And (( v_Flag <>"FirstKeyFound" ) Or (v_Flag<>"SecondKeyFound" )) Then Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWindow).Li nk("text:=.*" & v_Param4 & ".*", "index:=" & v_Index).Click ElseIf ( v_Flag ="SecondKeyFound" ) Then v_Flag ="SecondKeyFound" Exit Do ElseIf ( v_Flag ="FirstKeyFound" ) Then v_Flag ="FirstKeyFound" Exit Do Else v_Flag="None" ' Nothing is Found in Entire Table Exit Do End If Loop Until ( v_LinkExists="False") Select Case v_Flag Case "FirstKeyFound" If (v_Param2 <>"") Then s_FrameworkReportOutput " Invalid Input Param2 Exist !!!!! Only First Param1 Exist - Param1:"&v_Param1& vbNewLine &"Param2:"&v_Param2 , 2 , micFail End If Case "SecondKeyFound" s_FrameworkReportOutput "Both Entered Param Field Exist !!!!! Param1:"&v_Param1& vbNewLine &"Param2:"&v_Param2 , 2, micPass Case "ThirdKeyConstraintFound" s_FrameworkReportOutput "Input Field Value Does Not Exist Param1:"&v_Param1& vbNewLine &"Param2:"&v_Param2 , 2, micFail Case "None"

!!!!!

st !!!!!

s_FrameworkReportOutput "Input Param1 Field Value Does Not Exi Param1:"&v_Param1& vbNewLine &"Param2:"&v_Param2 , 2, micFail End Select

Case "LinkChildItem" ' Primtive Code being Replaced by better Dynamic co de LinkScrollSearch ' Created by Vivek 23 Oct 2007 ' Usage : v_Param1=Rowno; v_Param2=ColumnNo Dim v_LinkObj Set v_LinkObj=Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageWind ow).WebTable(v_FrameworkObject).ChildItem( v_Param1, v_Param2, "Link", 0) v_LinkObj.click Case "CheckBoxChildItem" ' Created by Vivek 5 Nov 2007 ' Usage : v_Param1=Row Value ' This library is restricted to only 04_BAS E_OGA_Authorise_Dual_1 test case of agency Dim v_CheckBoxObj v_Row= f_GetRecordRowByValIndex (v_Param1,2, 1) Set v_CheckBoxObj=Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPage Window).WebTable(v_FrameworkObject).ChildItem( v_Row, 1, "WebCheckBox", 0) v_CheckBoxObj.Set "ON"

Case "GetRecordRowByValIndex" 'PT 13/06/07 'Param 1 is the known row element you're looking for. Eg. BSB&AcctNo 'Param 2 is the is either an absolute value or a value. Refer to Ver ifyCellByRef's param 2 description for further information 'Param 3 is the number of the occurence that you want eg. If there a re two values of a record get the second one so enter 2 into param3 'Param 4 is the row number returned v_ColNum = f_DetermineWebTableCol (v_Param2) v_RowNum = f_GetRecordRowByValIndex (v_Param1, v_ColNum, v_Param3) DataTable("Param4", v_SheetName) = v_RowNum Case "GetCellByRef" ' This method will be updated so that v_Param1 contains EITHER the r ow number, OR the syntax x=Value, where x is the column to look in for Value ' The same will be done for v_Param2, except for Column rather than row. This allows combinations such as: ' 3, 2 means Row 3, Column 2 ' 3, 1=Name means Row 3, and the Column that contains Name in Row 1 (ie, Name is the Column heading, with headings store d in Row 1) ' 1=Customer, 1=Name means The Row that has Custo mer as a value in Column 1 (ie a row heading of Customer, with headings stored i n Column 1), and the same column as in the above example v_RowNum = f_DetermineWebTableRow (v_Param1) v_ColNum = f_DetermineWebTableCol (v_Param2) If v_RowNum <= 0 Or v_ColNum <= 0 Then s_FrameworkReportError "GetCellByRef attempted with invalid valu es, or values not found. Row: " & v_RowNum & " Col: " & v_ColNum Exit Sub End If

DataTable("Param3", v_SheetName) = Trim(Browser(v_FrameworkBrowserWi ndow).Page(v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(v_RowN um, v_ColNum)) Case "VerifyExistColumn" ' This Method will verify for cell values without knowing the reference in t he webtable 'Requires to pass in columnname(eg: OfficeId)as Param1 and values of the cel l as Param2 to be verified ' v_Param3= True/False ' helpful for reporting purposes v_RowNo=Trim(Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPageW indow).WebTable(v_FrameworkObject).RowCount) v_Columncount=Trim(Browser(v_FrameworkBrowserWindow).Page(v_Framewor kPageWindow).WebTable(v_FrameworkObject).ColumnCount(1)) v_NameOfColumn=UCase(Replace(v_Param1," ","")) v_ColumnValue=UCase(Replace(v_Param2," ","")) v_found="No" For i=1 To v_RowNo For j=1 To v_Columncount v_GetCellData0=(Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPa geWindow).WebTable(v_FrameworkObject).GetCellData(i,j)) v_GetCellData=UCase(Replace(v_GetCellData0," ","")) If (v_GetCellData<> "ERROR:THESPECIFIEDCELLDOESNOTEXIST. ") And (v_GetCellData<> "" ) Then v_Result1=InstrCmp(v_GetCellData,v_NameOfColumn) If (v_Result1="Found") Then v_found="Yes" v_ColunmNumber=j Exit For End If End If Next If v_found="Yes" Then Exit For End If Next v_Flag=False For i=1 To v_RowNo v_GetCellData0=CStr(Browser(v_FrameworkBrowserWindow).Page(v _FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(i,v_ColunmNumber)) v_GetCellData=Ucase(Replace(v_GetCellData0," ","")) If (v_GetCellData<> "ERROR:THESPECIFIEDCELLDOESNOTEXIST.") And (v_GetCellData<> "" ) And ( v_found="Yes") Then v_Result2= InstrCmp(v_GetCellData,v_ColumnValue) If (v_Result2="Found") Then v_flag=True Exit For End If End If Next

'Preset v_Exists to false in case of runtime error where object does not exist i n Object repository v_Exists = "False" v_Exists =v_Flag Select Case v_Exists Case "True" Select Case v_Param3 Case "True" s_FrameworkReportOutput "WebTable Value exists!!", 2, mi cPass Case "False" s_FrameworkReportOutput "WebTable Value does not exist", 2, micFail Case Else s_FrameworkReportError "Invalid value in Param1" End Select Case "False" Select Case v_Param3 Case "True" s_FrameworkReportOutput "Expected WebTable Value does no t exist", 2, micFail Case "False" s_FrameworkReportOutput "WebTable Value does not Exist", 2, micPass Case Else s_FrameworkReportError "Invalid value in Param1" End Select Case Else s_FrameworkReportError "Invalid Value returned by WebTable Valu e exists check" End Select Case "GetLastRowByVal" 'Param 1 is the known row element you're looking for. Eg. BSB&AcctNo 'Param 2 is the is either an absolute value or a value. Refer to Ver ifyCellByRef's param 2 description for further information 'Param 3 is the row number returned v_ColNum = f_DetermineWebTableCol (v_Param2) v_RowNum = f_GetLastRowByVal (v_Param1, v_ColNum) DataTable("Param3", v_SheetName) = v_RowNum Case "VerifyCellByRef" Dim v_WebTableCurrentValue ' This method will be updated so that v_Param1 contains EITHER the r ow number, OR the syntax x=Value, where x is the column to look in for Value ' The same will be done for v_Param2, except for Column rather than row. This allows combinations such as: ' 3, 2 means Row 3, Column 2 ' 3, 1=Name means Row 3, and the Column that contains Name in Row 1 (ie, Name is the Column heading, with headings store d in Row 1) ' 1=Customer, 1=Name means The Row that has Custo mer as a value in Column 1 (ie a row heading of Customer, with headings stored i n Column 1), and the same column as in the above example v_RowNum = Trim(f_DetermineWebTableRow (v_Param1)) v_ColNum = Trim(f_DetermineWebTableCol (v_Param2)) If v_RowNum <= 0 Or v_ColNum <= 0 Then s_FrameworkReportError "GetCellByRef attempted with invalid valu es, or values not found. Row: " & v_RowNum & " Col: " & v_ColNum Exit Sub

End If v_WebTableCurrentValue = Trim(Browser(v_FrameworkBrowserWindow).Page (v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(v_RowNum, v_ColN um)) If InStr(Trim(v_WebTableCurrentValue),Trim(v_Param3)) >0 Then s_FrameworkReportOutput "WebTable Value is Correct (" & v_WebTab leCurrentValue & ")", 2, micPass Else s_FrameworkReportOutput "WebTable Value is incorrect, '" & v_Web TableCurrentValue & "' instead of: '"& v_Param3 & "'", 2, micFail End If Exit Sub Case "OutputCellByRef" ' Vivek ' This method output the Value of webtable to v_Param3 ' v_Param1= x value ; v_Param2=y value ; v_Param3=Ouput Cell(Result) ' This method will be updated so that v_Param1 contains EITHER the r ow number, OR the syntax x=Value, where x is the column to look in for Value ' The same will be done for v_Param2, except for Column rather than row. This allows combinations such as: ' 3, 2 means Row 3, Column 2 ' 3, 1=Name means Row 3, and the Column that contains Name in Row 1 (ie, Name is the Column heading, with headings store d in Row 1) ' 1=Customer, 1=Name means The Row that has Custo mer as a value in Column 1 (ie a row heading of Customer, with headings stored i n Column 1), and the same column as in the above example v_RowNum = Trim(f_DetermineWebTableRow (v_Param1)) v_ColNum = Trim(f_DetermineWebTableCol (v_Param2)) If v_RowNum <= 0 Or v_ColNum <= 0 Then s_FrameworkReportError "GetCellByRef attempted with invalid valu es, or values not found. Row: " & v_RowNum & " Col: " & v_ColNum Exit Sub End If v_WebTableCurrentValue = Trim(Browser(v_FrameworkBrowserWindow).Page (v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(v_RowNum, v_ColN um)) DataTable("Param3", v_SheetName) =v_WebTableCurrentValue s_FrameworkReportOutput "WebTable Cell Values Output : (" & v_WebTab leCurrentValue & ")", 2, micDone Exit Sub Case "GetCellByRowValue" ' This method is no longer useful - it has been replaced by a new ad vanced version of VerifyCellByRef Dim v_TableRowCount, v_TableRowMax, v_MatchFound, v_KeyRowNum v_MatchFound = False v_TableRowMax = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPa geWindow).WebTable(v_FrameworkObject).GetROProperty("rows") For v_TableRowCount = 1 To v_TableRowMax v_WebTableCurrentValue = Trim(Browser(v_FrameworkBrowserWindo w).Page(v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(v_TableRo wCount, v_Param1))

If v_WebTableCurrentValue = v_Param2 Then ' We Have a Match v_MatchFound = True v_KeyRowNum = v_TableRowCount Exit For End If Next If v_MatchFound = False Then s_FrameworkReportError "Could not find Key Value: " & v_Param2 & " in table. Step skipped" Exit Sub End If ' We now know that row v_KeyRowNum contains our value, so can use th is and the provided col number to get the required value DataTable("Param5", v_SheetName) = Trim(Browser(v_FrameworkBrowserWi ndow).Page(v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetCellData(v_KeyR owNum, v_Param3)) 'Case "VerifyCellByRowValue" Case "GetRowCount" DataTable("Param1", v_SheetName) = Browser(v_FrameworkBrowserWindow) .Page(v_FrameworkPageWindow).WebTable(v_FrameworkObject).GetROProperty("rows") Case "GetValueCount" Dim v_StartRow, v_EndRow, v_StartCol, v_RowCounter, v_ColCounter, v_ CurrentCell, v_MatchCount v_MatchCount = 0 ' Param2 is the row to search in, or if blank, all rows ' Param3 is the column to search in, or if blank, all columns If v_Param2 = "" Then ' Start at Row 1 v_StartRow = 1 v_EndRow = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkPag eWindow).WebTable(v_FrameworkObject).GetROProperty("rows") Else v_StartRow = f_DetermineWebTableRow(v_Param1) v_EndRow = v_StartRow End If If v_Param3 = "" Then ' Start at Col 1 v_StartCol = 1 Else v_StartCol = f_DetermineWebTableCol(v_Param2) End If For v_RowCounter = v_StartRow To v_EndRow v_ColCounter = v_StartCol Do v_Temp = Browser(v_FrameworkBrowserWindow).Page(v_FrameworkP ageWindow).WebTable(v_FrameworkObject).GetCellData (v_RowCounter, v_ColCounter) v_CurrentCell =Trim(Replace(v_Temp," ","")) v_Param3=Trim(Replace(v_Param3," ","")) If v_CurrentCell = v_Param3 Then v_MatchCount = v_MatchCount + 1 End If If v_Param3 <> "" Or Left(v_CurrentCell, 5) = "ERROR" Then Exit Do End If v_ColCounter = v_ColCounter + 1

Loop Next DataTable("Param1", v_SheetName) = v_MatchCount Case "VerifyExists" 'Preset v_WebTableExists to false in case of runtime error where ob ject does not exist in Object repository v_WebTableExists = False v_WebTableExists = Browser(v_FrameworkBrowserWindow).Page(v_Framewor kPageWindow).WebTable(v_FrameworkObject).Exist(0) Select Case v_WebTableExists Case "True" Select Case v_Param1 Case "True" s_FrameworkReportOutput "Expected WebTable exists", 2, micPass Case "False" s_FrameworkReportOutput "Unexpected WebTable exists" , 2, micFail Case Else s_FrameworkReportError "Unknown result from WebTabl e Exists Method" End Select Case "False" Select Case v_Param1 Case "True" s_FrameworkReportOutput "Expected WebTable does not exist", 2, micFail Case "False" s_FrameworkReportOutput "WebTable does not exist", 2, micPass Case Else s_FrameworkReportError "Unknown result from WebTabl e Exists Method" End Select Case Else s_FrameworkReportError "Unknown Param attempted against Web Table Object" End Select Exit Sub Case Else s_FrameworkReportError "Unknown method attempted against Web Table Object" Exit Sub End Select ' If the Code gets here, we have completed without error. Report this to the log s_FrameworkReportOutput "Completed Successfully", 2, micDone End Sub

Vous aimerez peut-être aussi