06-08-2011, 10:28 AM
Hi VIns,
Thanks for replying my queries.
I will explain clearly, about my task. I want to create a new test program calculator application. Read data from data table in QTP, i entering data in Default.xls file in my test program folder. Now i am importing the default.xls file in to my global data table in qtp. I am able to read all the rows and colomn, and i able to add data using calculator application. Now i want to write result add, sub, mul and div value to excel data.
Please find the sample code of my program.
'''Code
''*****************************************************************************'''
I want to write result in excel file. Please help me to solve this issue.
Thanks & Regards,
Kamalakannan Anandan
Thanks for replying my queries.
I will explain clearly, about my task. I want to create a new test program calculator application. Read data from data table in QTP, i entering data in Default.xls file in my test program folder. Now i am importing the default.xls file in to my global data table in qtp. I am able to read all the rows and colomn, and i able to add data using calculator application. Now i want to write result add, sub, mul and div value to excel data.
Please find the sample code of my program.
'''Code
Code:
Dim nRow
Dim strValue1, strvalue2, strvalue3
Dim strAdd, strSub, strMul, strDiv
Dim Msg1, Msg2, Msg3, Msg4
Dim objFSO, strOutputFilePath
strValue1 = Datatable.Value(1, 1)
strValue2 = Datatable.Value(2, 1)
strvalue3 = Datatable.Value(3, 1)
nRow = Datatable.GetCurrentRow
''*****************************************************************************'''
Code:
''' Addition
Window("Calculator").WinButton("C").Click
Window("Calculator").WinEdit("Edit").Type(strValue1)
Window("Calculator").WinButton("+").Click
Window("Calculator").WinEdit("Edit").Type(strValue2)
Window("Calculator").WinButton("+").Click
Window("Calculator").WinEdit("Edit").Type(strValue3)
Window("Calculator").WinButton("=").Click
strAdd = Window("Calculator").WinEdit("Edit").GetROProperty("text")
Msg1 = MsgBox( "Colomn 1: " & strValue1 &Chr(13) & "Column 2: " & strvalue2 & Chr(13) & "Colomn 3: " & strValue3 & Chr(13) & "Addition Value: " & strAdd , 64, "MyCalc")
I want to write result in excel file. Please help me to solve this issue.
Thanks & Regards,
Kamalakannan Anandan