Forum Discussion
Prachi, Jason,
What WPF grid are you using? If this grid is supported by TestComplete, you can use the wValue property to retrieve cell values.
If TestComplete does not provide special support for your grid, try retrieving cell values with native methods and properties of the grid object. What methods and properties to use depends on your grid. You can explore the grid documentation or ask the developers. For instance, Xceed.Wpf.DataGrid contains the Items property that provides program interface for the grid rows. To obtain a cell value, you can use code like WPFObject("grid").Items.Item(0).Item(2). Here Item(0) corresponds to the first row of the grid and Item(2) corresponds to the third column in the row.
It is not recommended that you work with grid rows by using objects from the Object Tree. The tree displays objects that TestComplete recognizes in the tested application. Typically, these objects only correspond to visible rows (that is, this is the object structure in the tested application). Also, these objects change if you scroll the grid contents. This makes it difficult to work with the grid. The approach involving native methods and properties doesn't have such drawbacks.
Related Content
- 11 years ago
- 15 years ago
- 14 years ago
- 12 years ago
Recent Discussions
- 20 hours ago