This is a migrated thread and some comments may be shown as answers.

Third Party Data Grid Silverlight

5 Answers 39 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
donovan
Top achievements
Rank 1
donovan asked on 09 Apr 2014, 11:17 PM
Hello

I'm trying to select a cell on a third party DataGrid (ComponentOne FlexGrid) and I'm having some issues.

I cant seem to cast it as a Generic DataGrid and when I use CastAs<DataGrid> the rows and columns are coming back as 0.

I can see the children and they are there but I need to know how many columns there are to work out what item to select when they specify row and column.

I guess I could possibly add a property called columnCount to the control and then get it with GetProperty(). But I don't want to do that.

Is there a clean way I can get this info out ? In general if I have a collection can I use GetProperty or something similar to get its properties or its elements.

Thanks

5 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 14 Apr 2014, 10:45 PM
Hello Donovan,

First we need to know what type of application are you trying to test, HTML, Silverlight, WPF? I see ComponentOne has different Grid versions for different types of applications.

I doubt that using CastAs<DataGrid> would work. What that really does is to create a wrapper object that is specifically designed to work with the standard Silverlight DataGrid UI element. If there's any slight variation, it won't be able to adjust.

If you can point us to the right ComponentOne demo, then we may be able to investigate a solution for you.

Regards,
Cody
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
donovan
Top achievements
Rank 1
answered on 16 Apr 2014, 04:09 AM
Its for silverlight

Here you go http://demos.componentone.com/Silverlight/ControlExplorer/#FlexGrid/See%20it%20in%20action


0
Cody
Telerik team
answered on 17 Apr 2014, 07:46 PM
Hello Donovan,

Thank you for pointing me to the online demo. In studying their demo I discover they have made automating it very difficult. Each cell is simply another Border element. There is no separation of rows. The cells for row 2 are simply concatenated to the cells of row 1. Effectively you have just one long list of cells for every cell contained in the entire grid - see attached screen shot..

With this in mind, does the target cell you want to click have a unique value? We could find the grid by name or ID, then find the cell with the correct text then click on it.

Another approach would be to get the pixel height of the first row, do some calculation in order to click on row N with a static horizontal pixel value to click on.

The last option would be to add a RowCount and ColCount property, both returning an int, to a subclass of the grid. These properties would simply return Rows.Count and Cells.Count respectively.

if I have a collection can I use GetProperty or something similar to get its properties or its elements.

No I am sorry that is not supported. GetProperty can only return something our framework already knows how to handle. It needs to be able to serialize the object, send it "over the wall" (between the Silverlight application domain and the Test Studio application domain) such that Test Studio can deserialize the object. We only support the simple types (int, bool, string) and a few common complex types (Brush).

Regards,
Cody
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
donovan
Top achievements
Rank 1
answered on 21 Apr 2014, 11:44 PM
There is another issue when you edit a cell it inserts a new control into that list so the position of an element is not always where you expect it to be. Very annoying !

I think I might serialize some info (AutomationId for each cell and its position) into a string property called Schema and then use that wrapped in a custom FrameworkElement. 

Thanks for your help.
0
Cody
Telerik team
answered on 24 Apr 2014, 08:32 PM
Hi Donovan,

Yes you have run into another well known idiosyncrasy of the Siverlight Visual Tree, the visual order does not equal the visual tree order. I hope you can come up with some workable solution. It doesn't look easy.

Regards,
Cody
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
donovan
Top achievements
Rank 1
Answers by
Cody
Telerik team
donovan
Top achievements
Rank 1
Share this question
or