White is not able to retrieve table rows

73 views
Skip to first unread message

Divya Peddi

unread,
Jul 27, 2018, 5:18:35 AM7/27/18
to TestStack.White

Hi,

There is table of "ControlType.Table" in my application. White is able to recognize the table when I execute the following:

_mainWindow.Get<Table>(SearchCriteria.ByAutomationId(elementId));

But returns 0 rows under the table. 

There was a previous post on the same issue and there is a solution to retrieve table values in an array. This solution is working when the number of rows are less than 10. When the datagrid has more rows, the solution is not working. 

Can you please help me.

Thanks,
Divya.

Parthiban M

unread,
Jul 31, 2018, 2:42:33 AM7/31/18
to TestStack.White
Hi,
I am using below code for access cells in all rows from the table. It is working for me. Please share your screenshot of table Elements from spy tool 

TestStack.White.UIItems.TableItems.Table dataGrid = mainWindow.Get<Table>(SearchCriteria.ByAutomationId(gridID)); 
           
            //TestStack.White.UIItems.TableItems.TableCells tableCells = dataGrid.Rows[0].Cells;
            foreach (var row in dataGrid.Rows)
            {
                foreach (TableCell cells in row.Cells)
                {
                   
                    value = cells.Value.ToString();
Reply all
Reply to author
Forward
0 new messages