Nformation
10 years agoContributor
How do I click a grid row? Or, click a button in a cell?
I need a function that can click on the + button shown below for a given row index. So far, I've been unable to click it using the ClickCell method. I would be fine with clicking the left end of the row, but I can't find and click a row. This is a DevExpress grid.
The column's text is an empty string. I've tried the following...
var gridControl; // set gridControl object gridControl.ClickCell(index, "");
But I get the following error:
An error occurred.
Possible reasons:
1. The application stopped responding.
2. The application was compiled incorrectly (see the Open Applications topic in the help system).
3. An error occurred in TestComplete.
Technical information:
103 0x80020006 (Unknown name.) edit.
2. The application was compiled incorrectly (see the Open Applications topic in the help system).
3. An error occurred in TestComplete.
Technical information:
103 0x80020006 (Unknown name.) edit.
Thank you all for your suggestions. I had not been looking for the WPFObjects, which is where I eventually found what I needed. Here's what I came up with.
function clickDetailsButtonAtIndex(index) { // use when specifying the row: WPFObject("RowControl", "", index) index++; Aliases.Informa_Cashiering_Client.CurrentTransaction.ApplicationWindow.Grid.FloatingContainerBorder.Grid.FloatingContainerBody.border.Grid.PART_ContainerContent.Grid.ContentControl.ViewTransactionsView.Grid.GridControl.TableView.HierarchyPanel.WPFObject("RowControl", "", index).WPFObject("CellsControl", "", 1).WPFObject("LightweightCellEditor", "", 1).WPFObject("ButtonEdit", "", 1).Click(); }
This calls the Click() function on the button in the row specified by the index (I increment the index because I want the function to be 0-based). Thanks again!