Hi,
I am new to Ranorex and Automating Silverlight applications. I am supposed to automate clicking on a row in the the Datagrid based on its column value. Below are some details of the Datagrid
Ranorex Path: /dom[@domain='00.00.000.00']/body/form/div[@id='silverlightControlHost']/object/form/tabpagelist[6]/tabpage/table[@automationid='dg_Files']
AutomationID: dg_Files
ClassName:DataGrid
Frameworkid:Silverlight
IsContentElemet True
IsControlElement True
Can someone please guide me on how to instantiate the data grid and access elements in that
Silverlight: How to access rows/columns in Datagrid
Silverlight: How to access rows/columns in Datagrid
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Silverlight: How to access rows/columns in Datagrid
Hi,
Please could you post us a Ranorex Snapshot of the DataGrid. With this snapshot it is much easier to analyze your issue.
How to create a Ranorex Snapshot
Thanks in advance.
Regards,
Peter
Ranorex Team
Please could you post us a Ranorex Snapshot of the DataGrid. With this snapshot it is much easier to analyze your issue.
How to create a Ranorex Snapshot
Thanks in advance.
Regards,
Peter
Ranorex Team
Re: Silverlight: How to access rows/columns in Datagrid
Hi Peter,
Thanks for replying. Please find the snapshot attached as requested
Thanks for replying. Please find the snapshot attached as requested
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Silverlight: How to access rows/columns in Datagrid
From the snapshot this task looks pretty straight forward. Ranorex does not identify the cells correctly as such (they only show up as "Element", not as "Cell"), but still you can get to all data within them.rekha1234 wrote:Can someone please guide me on how to instantiate the data grid and access elements in that
The children of the "RowsPresenter" element represent the rows in the datagrid, i.e. the elements with name "System.ComponentModel.CheckableItem...". The children of the elements representing the rows are the actual cells of the grid, again containing elements for the content of the cells. Your code could look like the following:
Ranorex.Table table = "pathToTable"; IList<Ranorex.UIAutomation> rows = table.Find<UIAutomation>( "element[@automationid='RowsPresenter']/element"); // get cells of first row IList<Ranorex.UIAutomation> cellsInFirstRow = rows[0].Find<UIAutomation>("element");Regards,
Alex
Ranorex Team
Re: Silverlight: How to access rows/columns in Datagrid
Thanks alot for the Reply. Suggested code worked!!
Regards,
Rekha
Regards,
Rekha