Micro Focus QTP (UFT) Forums
last iteartions information is not getting passed into an excel - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: last iteartions information is not getting passed into an excel (/Thread-last-iteartions-information-is-not-getting-passed-into-an-excel)



last iteartions information is not getting passed into an excel - reshma2010 - 09-12-2010

Hi


I am trying to save the test result and send to a specific column in excel sheet. All the iterations are working fine except the last iteration.

Result is srored in runtime data table but not passing to the excel. This is only happening for the last iteration.
Ex:
Code:
For i =  1 to datatable.getsheet("Action1").getrowcount
       SystemUtil.Run statement
                
       DataTable.SetCurrentRow i
       DataTable.GetCurrentRow
              
   Dialog("Login").WinEdit("Agent Name:").Set   DataTable.Value("Username","Action1") '
   Dialog("Login").WinEdit("Password:").SetSecure DataTable.Value("Password","Action1")
   Dailog("Login").WinEdit("Password:").Type  micReturn  

       Recovery.Activate  
   If  Dialog("Login").Exist Then
      Dialog("Login").WinButton("Cancel")
      TestResult = "Fail"
   else
      TestResult = "Pass"
      Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"
   End If
            
DataTable.ExportSheet "C:\Login_TestData.xls","Action1"
DataTable ("Actual_Result","Action1")  = TestResult
                
Next

Could anyone help me to figure out why this is happening.

Thanks
Reshma


RE: last iteartions information is not getting passed into an excel - reshma2010 - 09-14-2010

Hi

Now the code is working.

Code:
DataTable.ExportSheet "C:\Login_TestData.xls","Action1"
DataTable ("Actual_Result","Action1") = TestResult

'It should be other way around

DataTable ("Actual_Result","Action1") = TestResult
DataTable.ExportSheet "C:\Login_TestData.xls","Action1"


Regards,
reshma