1

I am using RFT(8.2 version). I need to get the datagrid values. The AUT is developed in VB.Net(2005). I used the following code. But it returns the value as null. Please help me...

ITestDataTable tDTObj=(ITestDataTable) applicaGrid.getTestData("contents");
Object getVals=tDTObj.getCell(0,0);

I am also trying,

ITestDataTable tDTObj=(ITestDataTable) applicaGrid.getTestData("grid");

Both codes will throws null values.

Yamikuronue
  • 746
  • 8
  • 37

1 Answers1

2

While I haven't worked with VB.NET DataGridViews with RFT, based on our luck with C#.net,

I would recommend using the GuiTestObject.invoke() to work with the object. For example:

TestObject rows = (TestObject) dataGrid.invoke("get_Rows");
TestObject row = (TestObject) rows.invoke("get_Item", "(I)LSystem.Object;", new Object[] {rowIndex});
TestObject cells = (TestObject) row.invoke("get_Cells");
TestObject cell = (TestObject) cells.invoke("get_Item", "(I)LSystem.Object;", new Object[] {columnIndex});
String cellValue = (String) cell.invoke("get_Value");

Keep in mind you will need to know the method's signature when you need to call a method with parameters. Hope this helps.

Nathan R
  • 227
  • 2
  • 11