ControlDictionaryException:Could not find TestControl

Apr 11, 2011 at 6:06 PM

I'm new to White and not having much success.

List<Window> windows = Desktop.Instance.Windows();
Window mocWindow = windows.Find(
    delegate(Window w){
        return w.NameMatches("Office Communicator");
    });
Assert.IsNotNull(mocWindow);
mocWindow.LogStructure();
Button signInButton = mocWindow.Get<Button>("Sign In");
TextBox usernameBox = mocWindow.Get<TextBox>("User name edit box");

At this point, signInButton is a valid Button object, but the last line throws a ControlDictionaryException: Message=Could not find TestControl for ControlType=edit and FrameworkId:DirectUI

Here's the relevant snippet of the window structure:

AutomationId: 
ControlType: ControlType.Window
Name: Office Communicator
HelpText: 
Bounding rectangle: 1269,399,352,518
ClassName: CommunicatorMainWindowClass
IsOffScreen: False
FrameworkId: Win32
ProcessId: 5196

...

    AutomationId: 
    ControlType: ControlType.Pane
    Name: DUIBaseHWNDHost
    HelpText: 
    Bounding rectangle: 1272,421,346,493
    ClassName: NativeHWNDHost
    IsOffScreen: False
    FrameworkId: Win32
    ProcessId: 5196

...

        AutomationId: idEditUsername
        ControlType: ControlType.Edit
        Name: User name edit box
        HelpText: 
        Bounding rectangle: 1312,590,266,20
        ClassName: LogonEdit
        IsOffScreen: False
        FrameworkId: DirectUI
        ProcessId: 5196

...

        AutomationId: idSignin
        ControlType: ControlType.Button
        Name: Sign In
        HelpText: Begin signing in
        Bounding rectangle: 1312,756,100,24
        ClassName: CmdButton
        IsOffScreen: False
        FrameworkId: DirectUI
        ProcessId: 5196

 

So why does White know about a "DirectUI Button" but not a "DirectUI Edit box", and what can I do to resolve this?

Thanks in advance for any pointers.