Can't get dockable window, No TestControl For Window

Apr 24, 2009 at 12:05 PM
Using dockable windows that can be floating aswell. I can see the window in UISpy (named: "Treebrowser") but I can't fetch it with White.
The dockable windows can't be seen in UISpy when starting the application, but becomes floating when dragging them and are then seen in UISpy.

What I do is, get the mainWindow and Search for the window "Treebrowser".
with the following line:

 

Core.UIItems.WindowItems.

Window winTreeBrowser = (Core.UIItems.WindowItems.Window) guiTestWrapper.GetWindow(WindowTitle).Get(Core.UIItems.Finders.SearchCriteria.ByControlType(ControlType.Window).AndByText("Treebrowser"));

Assert.IsNotNull(winTreeBrowser);


StackTrace:
Core.Mappings.ControlDictionary.GetTestControlType(ControlType controlType, String frameWorkId)
Core.Mappings.ControlDictionary.GetTestType(AutomationElement automationElement)
Core.Factory.DictionaryMappedItemFactory.Create(AutomationElement automationElement, ActionListener actionListener)
Core.Factory.DictionaryMappedItemFactory.Create(AutomationElement automationElement, ActionListener actionListener, Type customItemType)
Core.Factory.PrimaryUIItemFactory.Create(SearchCriteria searchCriteria, ActionListener actionListener)
Core.UIItems.Container.NonCachedContainerItemFactory.Find(SearchCriteria searchCriteria)
Core.UIItems.Container.ContainerItemFactory.Get(SearchCriteria searchCriteria, ActionListener uiItemActionListener)
Core.Sessions.NullWindowSession.Get(ContainerItemFactory containerItemFactory, SearchCriteria searchCriteria, ActionListener actionListener)
Core.UIItems.Container.CurrentContainerItemFactory.Find(SearchCriteria searchCriteria, WindowSession windowSession)
Core.UIItems.UIItemContainer.Get(SearchCriteria searchCriteria)
Core.UIItems.UIItemContainer.Get(SearchCriteria searchCriteria)
GUITest.TreeBrowserTest.DragAndDropNMWindow() in C:\Source\GUITest\TreeBrowserTest.cs: line 120



Error Message:

 

Test method GUITest.TreeBrowserTest.DragAndDropWindow threw exception:  Core.WhiteException: AutomationId: c_Window
ControlType: ControlType.Window
Name: Configuration Center
HelpText:
Bounding rectangle: 154;203;646;598
ClassName: Window
IsOffScreen: False

    AutomationId:
    ControlType: ControlType.Window
    Name:
    HelpText:
    Bounding rectangle: Empty
    ClassName: Popup
    IsOffScreen: True

    AutomationId:
    ControlType: ControlType.Window
    Name: Treebrowser
    HelpText:
    Bounding rectangle: 378;452;198;100
    ClassName: Window
    IsOffScreen: False

        AutomationId: TitleBar
        ControlType: ControlType.TitleBar
        Name: Treebrowser
        HelpText:
        Bounding rectangle: 382;456;190;18
        ClassName:
        IsOffScreen: False
        .....
        ...
 --->  Core.Mappings.ControlDictionaryException: Could not find TestControl for ControlType=window and FrameworkId:WPF.


Is there a hack to get this to work? or to transform a AutomationElement to a UIItem manually in the test case??

Coordinator
May 8, 2009 at 3:02 PM

Can you provide the full trace as an attachment.