How to access datagridview using WhiteFramework

1,270 views
Skip to first unread message

mayu hoa

unread,
Feb 24, 2016, 3:18:31 AM2/24/16
to TestStack.White

Dear All,



I am using white framework to access UI elements (with UI Spy).

In my testing script, I am trying to access datagridview to select a row and do some operation.


table = _newWindow.Get<TestStack.White.UIItems.TableItems.Table>
  (SearchCriteria.ByAutomationId("dataGridView1"));


But I always get below error, even though my automation id is correct.

"TestStack.White.AutomationException: Failed to get ControlType=table,AutomationId=dataGridView1"

Is this the correct way to search datagridview in a form using White framework?



Thanks!!

Sudam Mandhane

unread,
Jun 3, 2016, 7:13:18 AM6/3/16
to TestStack.White
Here you should use ListView
ListView dataGrid = parentObj.Get<ListView>(SearchCriteria.ByAutomationId("gridControl"));
                var row = dataGrid.Rows[1];
                row.Select();
Reply all
Reply to author
Forward
0 new messages