Skip to content

TestStack.White.Mappings.ControlDictionaryException #277

Closed

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

Activity

  1. JakeGinnivan commented on Jan 6, 2015

    @JakeGinnivan
    Member

    This is a bug, it was introduced when trying to prepare for newer versions of the ui automation libraries..

    The issue is that the framework is not being passed down properly. I will see if I can fix it and a few other issues and get release out this week.

    Sorry about the rocky start to using White

    Sent from my Windows Phone


    From: starbug8866mailto:notifications@github.com
    Sent: ý06/ý01/ý2015 06:21
    To: TestStack/Whitemailto:White@noreply.github.com
    Subject: [White] TestStack.White.Mappings.ControlDictionaryException (#277)

    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 windows = application.GetWindows();
    IUIItem customToolsAddInsButton = windows[0].Get(SearchCriteria.ByText("Custom Tools (Add-Ins)"));
    customToolsAddInsButton.Click();

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

    Tree customToolsTree = customToolsPanel.Get();

    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

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/277.

  2. starbug8866 commented on Jan 6, 2015

    @starbug8866
    Author

    No worries, thank you for the quick response. Looking forward to the fix!

  3. VladislavKostyukevich commented on Jun 23, 2015

    @VladislavKostyukevich

    Hey,
    I have the same problem. Were found some solutions?

  4. szabolcslevay commented on Apr 6, 2016

    @szabolcslevay

    The issues is still not fixed.

  5. andrewtheart commented on May 12, 2016

    @andrewtheart

    Indeed, it does not appear to be fixed ... Jake, can you indicate when the regression was introduced so we can use a prior version?

  6. maninwindow commented on May 13, 2016

    @maninwindow

    @starbug8866 I had same issue. Eventually, i fixed it myself. My solution may not be the best, but have a solution is better than nothing. My Solution

  7. AustinMatherne commented on Jul 25, 2016

    @AustinMatherne
    Contributor

    @JakeGinnivan have you had a chance to look into this further? I'm evaluating using White to test an app with many trees.

  8. JakeGinnivan commented on Jul 25, 2016

    @JakeGinnivan
    Member

    No I haven't. I'm not using White currently and can't dedicate the time to fixing this up.

    I am more than happy to add anyone as a contributor and can also skype to answer any questions I still remember but I don't think I will get to this soon.

  9. AustinMatherne commented on Jul 25, 2016

    @AustinMatherne
    Contributor

    Thanks, I appreciate the offer. I'm about to tackle a large project with White. I'd be quite happy to be added as a contributor.

    There's actually already an open pull request that resolves this issue (at least for me) #450. Can we get it merged?

  10. AustinMatherne commented on Aug 7, 2016

    @AustinMatherne
    Contributor

    @JakeGinnivan just following up on this. Can you add me as a contributor?

  11. JakeGinnivan commented on Aug 11, 2016

    @JakeGinnivan
    Member

    @AustinMatherne done, sorry for the delay :)

  12. omireault commented on Sep 28, 2016

    @omireault

    I didn't isolate my fix properly, so I had to restart the PR request.

  13. gpomykala commented on Feb 23, 2017

    @gpomykala
    Contributor

    can someone publish a nuget package?

  14. sark2323 commented on Dec 6, 2017

    @sark2323

    is there a solution for this issue?

  15. added a commit that references this issue on Mar 9, 2024
    1479e24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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