The SWTTable control provides no in-built functionality to get the value of a cell held within a table. When inspecting an SWTTable control we find that there are generally a number of SWTTableRow child controls, it is these control that hold the values that are displayed in the SWTTable. Therefore using this information we can construct a function that will allow us to return the value of a particular cell, for example:

[-] String GetCellValue(window wSWTTable, int iRow, int iCol)
 [ ] //get the all the rows within the SWTTable
 [ ] list of window lwRows = wSWTTable.FindAll("//SWTTableRow")
 [ ]
 [ ] //if the row or column specified is invalid raise an error
 [-] if(iRow > wSWTTable.RowCount || iRow < 1)
  [ ] raise E_ROW_INDEX_INVALID, "***ERROR: Specified row value is invalid"
 [-] if(iCol > wSWTTable.ColumnCount || iCol < 1)
  [ ] raise E_COLUMN_INDEX_INVALID, "***ERROR: Specified column value is invalid"
 [ ]
 [ ] //return the cell value
 [ ] return lwRows[iRow].Items[iCol]

To use the above function within a testcase we would simply perform the following:

[-] testcase TestFunction() appstate none
 [ ] //Get value of the cell at row 3 and column 1
 [ ] print(GetCellValue(Desktop.find("//SWTTable[@caption='MyTable']"), 3,1))