Micro Focus QTP (UFT) Forums

Full Version: Help on how to build checkpoint to compare PB datawindow values row by row
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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..
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.