Fitnesse - How to retrieve particular value from the Grid and assign it to the particular variable for validation? How can I compare two values ? Is there a way to use if condition here ?

 How to retrieve particular value from the Grid and assign it to the particular variable for validation? How can I compare two values ? Is there a way to use if condition here ?

In a below screenshot there are two columns Old value and New Value those I want to compare with the previous values.

  Discussion posts and replies are publicly visible

Parents
  • use below to get the value fron grid and store it in variable name.
    |$variabename=|get grid |GRID_NAME or [GRID_INDEX] or GRID_NAME[INDEX] |column |COLUMN_NAME or [COLUMN_INDEX]|row |[ROW_INDEX] |value |

    then use below to verify if the value is available in the grid. (replace VALUE with variablename)
    |verify grid |GRID_NAME or [GRID_INDEX] or GRID_NAME[INDEX] |column |COLUMN_NAME or [COLUMN_INDEX]|row |[ROW_INDEX] |contains value|VALUE |
  • Thank you for your reply!!!

    I tried the above code but the second one is not working

    |$getStatus=|get grid |[1]|column | [1]|row |[1] |value |
    |verify grid|[1]|column | [1]|row |[1] |contains|$getStatus|

    above second line of code shows error,
    $getStatus<-[All] get grid [1] column [1] row [1] value
    verify grid [1] column [1] row [1] contains $getStatus->[All]

    On application value is "All" but while running it gives value with $getStatus->[All]
    is there a way to split value which is getting saved in $getStatus variable
Reply
  • Thank you for your reply!!!

    I tried the above code but the second one is not working

    |$getStatus=|get grid |[1]|column | [1]|row |[1] |value |
    |verify grid|[1]|column | [1]|row |[1] |contains|$getStatus|

    above second line of code shows error,
    $getStatus<-[All] get grid [1] column [1] row [1] value
    verify grid [1] column [1] row [1] contains $getStatus->[All]

    On application value is "All" but while running it gives value with $getStatus->[All]
    is there a way to split value which is getting saved in $getStatus variable
Children
No Data