How to handle SplitContainer?

Aug 18, 2008 at 6:46 AM
I'm trying to use White to test a CAB application.  There are many levels of UI controls involved, given that CAB defines "workspaces" which are basically containers that you put additonal workspaces or views into.  In one of my views, I am using a Windows.Forms.SplitContainer.  I'm not sure how to handle this, as the SplitContainer manages two panels, Panel1 and Panel2.  Using UISpy, everything is a ControlType.Pane, with the SplitContainer containing two child panes.  However, there is no way to set automation id's for these as they appear to be randomly assigned.  For example, in the instance that I am currently running, it appears that Panel1 has an automation id of 656820 and Panel 2 has an automation id of 656816.  However, the next time I run, these values are totally different.

Is there any good way to deal with something like this?  Also, what I am doing is starting from the main application window, I am calling Get<> to get the next level ControlType.Pane and making my way about 10 levels down to get at the actual DataGrid control that I am interested in.  Is there any easier way to do this?  If I use the SearchCriteria to search byAutomationId on the DataGrid's name from the application Window, I can find it ok.  Unfortunately, it looks like it comes back as a Table, and I would really need it to be a ListView so that I can manipulate it.

Any insights would be greatly appreciated.
Coordinator
Aug 19, 2008 at 7:10 PM
If you want to get hold of the DataGrid then you can find it directly from the window as you are doing. You dont need to make your way down manually. DataGrid from WinForm comes out as table always. I would want to know what is that you are not able to get from Table which you would get from ListView.
Aug 20, 2008 at 12:47 AM
Vivek, thanks for the response.  I may not actually need the ListView, but the Table that I get back appears to be incomplete.  The finder, header, rows, and tableRowFactory are all null when it comes back.  I'm not sure exactly why that is, but since I don't have access to the Rows, there's not much that I can do with the Table.
Coordinator
Aug 20, 2008 at 3:37 PM
Can you do a window.LogStructure and send me the output.
Aug 21, 2008 at 1:59 AM
Edited Aug 21, 2008 at 2:01 AM

Here is the output.  There's actually a lot more controls, but I cut it down to the relevant hierarchy that leads down to the _claimsGridView which is what I am after.

    AutomationId: RootDeckWorkspace
    ControlType: ControlType.Pane
    Name: deckWorkspace
    HelpText:
    Bounding rectangle: 132,133,1016,576
    ClassName: WindowsForms10.Window.8.app.0.2e0c681
    IsOffScreen: False

        AutomationId: MainClaimsViewLayout
        ControlType: ControlType.Pane
        Name:
        HelpText:
        Bounding rectangle: 132,133,1016,576
        ClassName: WindowsForms10.Window.8.app.0.2e0c681
        IsOffScreen: False

            AutomationId: ClaimsListLayoutWorkspace
            ControlType: ControlType.Pane
            Name:
            HelpText:
            Bounding rectangle: 132,133,1016,576
            ClassName: WindowsForms10.Window.8.app.0.2e0c681
            IsOffScreen: False

                AutomationId: panel1
                ControlType: ControlType.Pane
                Name:
                HelpText:
                Bounding rectangle: 132,133,1016,576
                ClassName: WindowsForms10.Window.8.app.0.2e0c681
                IsOffScreen: False

                    AutomationId: MainClaimsGrid
                    ControlType: ControlType.Pane
                    Name:
                    HelpText:
                    Bounding rectangle: 132,133,1016,576
                    ClassName: WindowsForms10.Window.8.app.0.2e0c681
                    IsOffScreen: False

                        AutomationId: toolStripContainer2
                        ControlType: ControlType.Pane
                        Name: toolStripContainer2
                        HelpText:
                        Bounding rectangle: 132,133,1016,576
                        ClassName: WindowsForms10.Window.8.app.0.2e0c681
                        IsOffScreen: False

                            AutomationId: 460540
                            ControlType: ControlType.Pane
                            Name:
                            HelpText:
                            Bounding rectangle: 132,133,1016,576
                            ClassName: WindowsForms10.Window.8.app.0.2e0c681
                            IsOffScreen: False

                                AutomationId: splitContainer1
                                ControlType: ControlType.Pane
                                Name:
                                HelpText:
                                Bounding rectangle: 132,133,1016,576
                                ClassName: WindowsForms10.Window.8.app.0.2e0c681
                                IsOffScreen: False

                                    AutomationId: 460510
                                    ControlType: ControlType.Pane
                                    Name:
                                    HelpText:
                                    Bounding rectangle: 132,133,1016,386
                                    ClassName: WindowsForms10.Window.8.app.0.2e0c681
                                    IsOffScreen: False

                                        AutomationId: _claimsGridView
                                        ControlType: ControlType.Table
                                        Name: DataGridView
                                        HelpText:
                                        Bounding rectangle: 132,133,1016,386
                                        ClassName: WindowsForms10.Window.8.app.0.2e0c681
                                        IsOffScreen: False

                                    AutomationId: 460530
                                    ControlType: ControlType.Pane
                                    Name:
                                    HelpText:
                                    Bounding rectangle: 132,523,1016,186
                                    ClassName: WindowsForms10.Window.8.app.0.2e0c681
                                    IsOffScreen: False

                                        AutomationId: splitContainer2
                                        ControlType: ControlType.Pane
                                        Name:
                                        HelpText:
                                        Bounding rectangle: 132,523,1016,186
                                        ClassName: WindowsForms10.Window.8.app.0.2e0c681
                                        IsOffScreen: False

                                            AutomationId: 460484
                                            ControlType: ControlType.Pane
                                            Name:
                                            HelpText:
                                            Bounding rectangle: 132,523,337,186
                                            ClassName: WindowsForms10.Window.8.app.0.2e0c681
                                            IsOffScreen: False

                                                AutomationId: AutoPicture
                                                ControlType: ControlType.Pane
                                                Name:
                                                HelpText:
                                                Bounding rectangle: 134,525,333,182
                                                ClassName: WindowsForms10.Window.8.app.0.2e0c681
                                                IsOffScreen: False

                                            AutomationId: 460480
                                            ControlType: ControlType.Pane
                                            Name:
                                            HelpText:
                                            Bounding rectangle: 473,523,675,186
                                            ClassName: WindowsForms10.Window.8.app.0.2e0c681
                                            IsOffScreen: False

 

Aug 26, 2008 at 8:13 PM
Has anyone else encountered the inaccessible Table issue?  There have been a lot of posts regarding DataGrids, but I haven't really been able to piece together whether these are all distinct issues or related to something common.
Coordinator
Sep 2, 2008 at 8:30 PM
Seems like your Table is indeed empty as understood by UIA. There is a little white can do to help you here.
Can you provide some code as to how to do create a table which is not understood by UIA. It would help me reproduce such problems and look for solutions.
Sep 11, 2008 at 8:58 PM
Thanks Vivek.  When I get a chance, I'll try to create a small sample app to recreate this problem.
Feb 24, 2009 at 9:25 PM
Hello,

how to get windows Splitter control and read property SplitterDistance with white.
As well I was having problem to drag splitter bar to specific position.

Thanks.
Zoran.