hi all,
i want to use excel for datadriven testing instead of datapools.can any one assist me with tha code and how to work with excel please.
hi all,
i want to use excel for datadriven testing instead of datapools.can any one assist me with tha code and how to work with excel please.
Below code will be useful for read/write into excel
Dim app as object
Dim book as object
Dim sheet as object
set app=createobject("excel.application")
set book=app.workbooks.open("c:\emp.xls")
set sheet=book.activesheet
sheet.cells(1,1).value="hello" 'first one is row and second one is column value
I have got a piece of code if u can use it then its good just check it its written below
'on error resume next
'open data source
dim objexcel as object
dim objworkbook as object
dim objworksheet as object
set objexcel = getobject("excel.application")
if objexcel is nothing then
set objexcel = createobject ("excel.application")
end if
set objworkbook = objexcel.workbooks.open("c:\testing\testdata\placeanorderdata.xls")
set objworksheet = objworkbook.worksheets("placeanorder")
end sub
how to use the datatable instead of datapool in rational robot?
Hi try the below code to get the data from the EMP table
Before execting the below table you should create a DSN
---------------------------------------------------------------------------
Dim DBC as Long
Dim varColumn
Dim varRows
Dim strArray (3,50) as String 'Assuming that the EMP table has 3 columns and 50 rows
DBC = SQLOpen("DSN=DataDSN;UID=userid;PWD=passwore",,prompt:=3)
If DBC < 0 Then
Msgbox "Not Connected"
End If
varColumns = SQLExecQuery(DBC,"Select * from EMP")
varRows = SQLRetrieve(DBC,strArray)
I Tried the same script , But its showing an error message that "Illegal Statement", Any add-ins is there to identify the Script.
Could you please give your valuable thoughts