Micro Focus QTP (UFT) Forums
Help on how to build checkpoint to compare PB datawindow values row by row - 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: Help on how to build checkpoint to compare PB datawindow values row by row (/Thread-Help-on-how-to-build-checkpoint-to-compare-PB-datawindow-values-row-by-row)



Help on how to build checkpoint to compare PB datawindow values row by row - martinlam - 08-30-2010

Dear all,

Please do help on the captioned subject. Thank you very much.

Here is the sample code with ERROR:
Code:
With PbWindow("PbWin1")
   For i = 1 to .PbDataWindow("dw_list").RowCount
      .PbDataWindow("dw_list").SelectCell i,"id"
      For j = 1 to datatable.GetSheet("ChkList").GetRowCount
         datatable.GetSheet("ChkList").SetCurrentRow(j)
         id=DataTable("id", "ChkList")
         If id = parameter("ID") Then
            datatable.GetSheet("ChkList").SetCurrentRow(j+i-1)
            .PbDataWindow("dw_list").Check CheckPoint("ChkList")
            Exit For
         End If
      Next
   Next
End With

DataTable:
Id Value
1 11
1 22
2 33
3 44
3 55

Actually, I want to validate a PBdatawindow or webtable with 3 rows data. I used the aboved code but don't know how to pass the data row by row to checkpoint since the checkpoint will validate 1 row only at once time.


RE: Help on how to build checkpoint to compare PB datawindow values row by row - PrabhatN - 09-02-2010

Hi,

If I have correctly understood you then you want to verify the value of three rows of a WebTable with the value of three rows of the DataTable.

If this is the case, then instead of using checkpoint, I'll suggest you to fetch data from the WebTable by "GetCellData" method and compare it with the value of current row of the DataTable. If it matches then report Pass, if not then report Fail. You can loop it as many time you want to.

If this is not what you want to do, then I beg your pardon.

Please let me know on this..


RE: Help on how to build checkpoint to compare PB datawindow values row by row - martinlam - 09-03-2010

Dear PrabhatN,

Thank you for your reply. Could you give me some sample code since some columns in my webtable is hidden, it will get run-time error if use your suggested method.

Thank again.