Does anyone know of any problems related to testing jide grids with TestComplete? We are having trouble, and are working with the TestComplete vendor as well (AutomatedQA) but they are not familiar with jide components, so I thought I would ask here as also.
Basically, in a TestComplete script we can get a handle to any object, and can call methods on it to assert certain values are correct. You have access to the entire object model of the application you are testing. TestComplete supports writing scripts in several languages, but we are using VBScript currently. The code being tested is in Java (obviously). Here is a small sample:
Sub Test
Set shipmentTable = SwingObject("JScrollPane", "", 0).SwingObject("JViewport", "", 0).Shipment_table
Set shipmentModel = shipmentTable.getModel
Set cellValue = shipmentModel.getValueAt(2, 0)
Set cellStyle = shipmentModel.getCellStyleAt(2, 0)
End Sub
In our code, the Shipment_table is a com.jidesoft.grid.HierarchicalTable. The shipmentModel class extends AbstractTableModel (which is why we can call getValueAt) and it also implements StyleModel, which is why we can (or should be able to) call getCellStyleAt. We have implemented the method getCellStyleAt in our model, to make some cells have a different foreground color (red). In the test, we want to assert that the foreground color is correct for those cells.
In the script above, the call to getValueAt returns the correct value for that cell. But the call to getCellStyleAt returns nothing (an "empty object" is what TestComplete calls it) and the script fails.
Can anyone think of a reason why we would not be able to get a CellStyle object back? I know in the application code we never call GetCellStyleAt directly - it is only called by the renderer when cells are being painted. But I still don't know why we couldn't call it directly in our test.
Thanks for any help or ideas about this.