Unable to select specific cell in XamDataGrid
Hi,
Am trying to select a cell in xamdatagrid using winappdriver, but i couldn't. can someone help me how to do this.
Can anyone please share me the code or how we can identify the particular cell or select row in the grid. Its bit urgent for me.
I guess you're using Infragistics XamDataGrid? Give it a x:Name. Then you should be able to find it like this FindElementByAccessibilityId("GridName");
Thanks kaan1808 for the reply. I am able to find the Grid, but I need to select particular cell in that grid. not sure how we can identify particular cell in the grid. using inspect.exe am able to see the column header and index of the columns and value in that cell. might be we may need to write XPATH to get that value?
can anyone please suggest any code snippet to identify the particular column/cell in the xamDataGrid
any suggestions please
You can try following snippet:
driver.FindElementByXPath("//List[@AutomationId='the table id']/ListItem[row index]/Text[column index]")
where the table id is the AutomationId property of the xamdatagrid element,
or in case of using name property: //List[@Name='the table name']
I haven't working with xamdatagrid but I think it is similar with general table element.
Example: select cell on first row, second column
driver.FindElementByXPath("//List[@AutomationId='dataGrid1']/ListItem[1]/Text[2]")
Have a note that the element tag name List, ListItem, Text might be different in your case.
You can check from the Inspect.exe and update if necessary.