Professional Documents
Culture Documents
Approach 1:
For example, in the above table if the WebEdit step is failed then how
do we figure out the failure for which object in the application by just
using “name:=q” property. If we have assigned those properties to a
constant which is having an understandable name then it will be very
easy to identify for which object the failure occurs.
So now we have Excel Keywords and Object Description Constants. We
have to write driver script. Follow the below steps prior to write the
driver script.
Now you should have the Folder structure like specified below
Now you can save the below script in Driver Script and Run it.
'###################################################################
' Objective : This is a driver script for Sample Keyword Driven Framework
' Test Case : Driver Script
' Author : Sudhakar Kakunuri
' Date Created : 01/16/2010
' Date Updated : 01/16/2010
'Updated by : Sudhakar Kakunuri
'###################################################################
'##############Initialize Variables and Load Libraries#############################
ExecuteFile "..\..\Costants\OR Constants.vbs"
'#####################Driver Script ######################################
'Add a new sheet and import keywords
Set dtKeyWords=DataTable.AddSheet("Keywords")
Datatable.ImportSheet "..\..\Keywords\ScriptKeywords.xls","Sheet1","Keywords"
'Get Row Count and Column Colunt of the databable
dtRowCount=dtKeyWords.GetRowCount
dtColumnCount=dtKeyWords.GetParameterCount
'Use for lop to get values row by row
For dtRow=1 to dtRowCount
dtKeyWords.SetCurrentRow (dtRow)
strObjClass = DataTable("ObjectClass","Keywords")
strObjProperties = DataTable("ObjectProperties","Keywords")
strOperation = DataTable("Operation","Keywords")
strValue = DataTable("Value","Keywords")
If strOperation="SetParent" Then
oParentObjectArray=Split(strObjClass,"/")
oParentObjectPropArray=Split(strObjProperties,"/")
For iParentCount=0 to ubound(oParentObjectArray)
iParent=oParentObjectArray(iParentCount)
iParentProps=oParentObjectPropArray(iParentCount)
If iParentCount=ubound(oParentObjectArray) Then
strParent=strParent&iParent&"("&""""&eval(iParentProps)&""""&")"
Exit For
End If
strParent=strParent&iParent&"("&""""&eval(iParentProps)&""""&")."
Next
ParentObject=strParent
Else
oStatement=ParentObject&"."&strObjClass&"("&""""& eval(strObjProperties) &""""&
")."& strOperation
If strValue<>"" Then
iStrInputDataArray=split(strValue,",")
For iInputValuesCount=0 to UBound(iStrInputDataArray)
If iInputValuesCount=UBound(iStrInputDataArray) Then
oStatement=oStatement&" "&""""& iStrInputDataArray(iInputValuesCount)
&""""
Exit for
End If
oStatement=oStatement&" "&""""& iStrInputDataArray(iInputValuesCount) &""""&","
Next
End If
Execute (oStatement)
End If
Next
'###################################################################