WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

Unable to select specific cell in XamDataGrid

Open Vasanthi30 opened this issue 7 years ago • 6 comments

Hi,

Am trying to select a cell in xamdatagrid using winappdriver, but i couldn't. can someone help me how to do this.

Vasanthi30 avatar Jan 24 '19 10:01 Vasanthi30

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.

Vasanthi30 avatar Jan 25 '19 06:01 Vasanthi30

I guess you're using Infragistics XamDataGrid? Give it a x:Name. Then you should be able to find it like this FindElementByAccessibilityId("GridName");

kaan1808 avatar Jan 28 '19 14:01 kaan1808

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?

Vasanthi30 avatar Jan 29 '19 05:01 Vasanthi30

can anyone please suggest any code snippet to identify the particular column/cell in the xamDataGrid

Vasanthi30 avatar Mar 13 '19 11:03 Vasanthi30

any suggestions please

Vasanthi30 avatar Jul 30 '19 05:07 Vasanthi30

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.

phibao37 avatar Jul 30 '19 07:07 phibao37