Micro Focus QTP (UFT) Forums
Write Status of each row in DataTable - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Write Status of each row in DataTable (/Thread-Write-Status-of-each-row-in-DataTable)



Write Status of each row in DataTable - dlaureano - 11-28-2012

Hi, I'm new to QTP and using QTP11.

I'm processing a thousand records and every time a row is processed I need to put a "Passed" or "Run Time Error" next to each current row in the Action1 Sheet of the DataTable. I already have this code(see below) which use the Reporter and is also writing to the DataTable, but instead of writing next to each Row is creating a New Column every time a record is processed.

I'll really appreciate your advice and give me some example of what I need.

Code:
If Browser("QNXT - Benefit Plan Module").Window("About QNXT -- Webpage").Page("About QNXT").Frame("Frame").WebButton("Cancel").Exist Then
    Reporter.ReportEvent micPass, "Record Verification", "Record has been saved"
    DataTable.GlobalSheet.AddParameter "A", "Passed"
Else
    Reporter.ReportEvent micWarning, "Record Verification", "Record not Completed"
    DataTable.GlobalSheet.AddParameter "A", "Run Time Error"
End If



RE: Write Status of each row in DataTable - ssvali - 11-29-2012

Hope you are executing ur code in for loop. The below code always write in Global sheet

Code:
For i = 1 to 3

If  Browser("QNXT - Benefit Plan Module").Window("About QNXT -- Webpage").Page("About QNXT").Frame("Frame").WebButton("Cancel").Exist Then
    DataTable.SetCurrentRow(i)
    DataTable("Result") = "Passed"
Else
    DataTable("Result") = "Run Time Error"
End If

Next



RE: Write Status of each row in DataTable - dlaureano - 11-29-2012

Excelent! It works! Thanks a lot.