Basically, I have a datagrid (according to the spy the role is "Table") that only has rows recognized and not columns.
In QTP, we get the column name by index like this:
Code: Select all
Set objTable = SwfWindow("Volume Markups for Customer").SwfTable("dataGrid")
If objTable.RowCount = 0 Then
Exit Sub
End If
'get column names
intTotalColumns = objTable.ColumnCount
For intColumn = 1 to intTotalColumns - 1
If objTable.GetCellProperty(0, intColumn, "colname") = "Currency" Then
intCurrencyColumn = intColumn
ElseIf objTable.GetCellProperty(0, intColumn, "colname") = "Amount up to" Then
intAmountColumn = intColumn
ElseIf objTable.GetCellProperty(0, intColumn, "colname") = "Markup percentage" Then
intMarkupColumn = intColumn
End If
Next
Am I missing something?
On a potentially related topic, the treeview to the left of the grid in the screenshot... I can't access it at all. Ranorex sees it as a tree, but says it doesn't contain any Items.
We have a workaround for it that's pretty clean
Code: Select all
IList<Row> dataRows = RxSppAdminMain.RxGetRepository().RxFormVolumeMarkups.TableDataGrid.Rows;
foreach (Row dataRow in dataRows)
{
Cell currencyCell = dataRow.FindChild<Cell>("Currency");
Cell amountCell = dataRow.FindChild<Cell>("Amount up to");
if (currencyCell.Text.Contains(currency) && amountCell.Text == amount)
{
foundRow = dataRow;
return true;
}
}
foundRow = null;
return false;
Thanks!