locked
Custom control - Advanced treeview RRS feed

  • Question

  • Trying to automate a Winforms application which is having Advanced Treeview Control.

    Can someone please guide me how to capture individual nodes of custom tree...

    Also is it required to make changes in the custom control being implemented in application by dev.

    Ankush 


    • Edited by Amit_ Tuesday, July 10, 2012 9:03 AM
    Tuesday, July 10, 2012 6:08 AM

Answers

  • Hi Ankush,

    Thank you for posting in the MSDN forum.

    Not very sure how you create the custom control “Treeview”, but if we use the Coded UI Test Builder to record a coded UI test for the Winforms app with the default Toolbox control TreeView, it could capture all the nodes. You also could write the code to capture it.

    foreach(var item in this.UIForm1Window.UITreeView1Window.UIParentTreeItem.Nodes)
    {
    //Mouse.Click(item);

    if (this.UIForm1Window.UITreeView1Window.UIParentTreeItem.Name == "Child 2")
    {
    Mouse.Click(this.UIForm1Window.UITreeView1Window.UIParentTreeItem);
    }

    }

    Maybe you could try to use the Coded UI Test Build to record a coded UI test for it and check it.

    References:

    UITest framework – Winforms Plugin - Part 1

    Problems adding automation support to a custom WinForms TreeView control.

    If still no help, I suggest you share us a simple sample, we try to check it. Please attach your Visual Studio project, you can upload it to the sky driver, and then share the download link in your post.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, July 12, 2012 3:05 AM
    Moderator