Micro Focus QTP (UFT) Forums
Pulling data from grid (WbfGrid) for checkpoin - 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: Pulling data from grid (WbfGrid) for checkpoin (/Thread-Pulling-data-from-grid-WbfGrid-for-checkpoin)



Pulling data from grid (WbfGrid) for checkpoin - yorkes - 03-25-2010

Hello,

We are attempting to pull data from a grid and if it has a certain value (as it might not have a value) then to pass or fail as a checkpoint based on the value.

I am able to pull the data from the cell as below and if it exists it has a value, if it does not exist then value is null.

Code:
var_GetCellData = Browser("Browser").Page("...").WbfGrid("...GridV").GetCellData(2,5)

If I used a standard checkpoint then it will fail if there is not any data in the cell. This is why I need to do the check by this or some other method.
What I am thinking is that if there is checkpoint to validate by a variable or if there is a way to write a check to the test results summary.


Sorry if this is the incorrect forum.

Regards,

Stephen


RE: Pulling data from grid (WbfGrid) for checkpoin - jsknight1969 - 03-25-2010

If you are using checkpoints currently then you must have expected values in the field. Using If or Select statements to manually validate the cell and generate results should work.

Code:
var_GetCellData = Browser("Browser").Page("...").WbfGrid("...GridV").GetCellData(2,5)
Select case _GetCellData
  Case "A" 'this is an expected value
    Reporter.ReportEvent micDone, "Cell Results", _GetCellData
  Case else
    Reporter.ReportEvent micDone, "Cell Results", "Cell is Empty
End Select

Using the select to test for a result. If you want to just report the value then remove the select and just use the Reporter event. Hope this helps.


RE: Pulling data from grid (WbfGrid) for checkpoin - yorkes - 03-25-2010

This sent me down the correct path.

Thanks for all the help.