Skip to content

TestStack.White.Mappings.ControlDictionaryException #277

Closed
@starbug8866

Description

@starbug8866

Hi,

I am just starting out on White and I am getting the following error when trying to access the nodes of a tree within my .NET 4 app:

'An exception of type 'TestStack.White.Mappings.ControlDictionaryException' occurred in TestStack.White.dll but was not handled in user code

Additional information: Multiple TestControls found for ControlType=tree view item and FrameworkId: - TestStack.White.UIItems.TreeItems.Win32TreeNode, TestStack.White.UIItems.TreeItems.WPFTreeNode, TestStack.White.UIItems.TreeItems.Win32TreeNode'

The code is as follows:

List<Window> windows = application.GetWindows();
IUIItem customToolsAddInsButton = windows[0].Get(SearchCriteria.ByText("Custom Tools (Add-Ins)"));
customToolsAddInsButton.Click();

Panel customToolsPanel = windows[0].Get<Panel>(SearchCriteria.ByAutomationId("Function.CustomTools"));

Tree customToolsTree = customToolsPanel.Get<Tree>();

foreach(TreeNode node in customToolsTree.Nodes) // Exception thrown here
{
    // do something
}

I am also using Visual UI Automation Verify and can see that the nodes are there (and can see them within the app UI). Within Verify, the hierarchy looks as follows:

  • "pane" "" "Function.CustomTools"
    • "tree" "" "5376242"
    • "tree item" "This is some text"

Any help you can give is will be appreciated.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions