UI Automation Infragistics UltraWinTree Collapse
Asked Answered
H

0

7

In Windows Forms we are using Infragistics UltraWinTree control.

Goal : collapse all the tree items using UI Automation(UIAutomationClient.dll).

For more details about the UI Automation please refer: https://msdn.microsoft.com/en-us/library/ms747327(v=vs.110).aspx

Below is the code.

 if (true == elementNode.TryGetCurrentPattern(InvokePattern.Pattern, out object patt))
    {
          invokePattern = patt as InvokePattern;
          invokePattern.Invoke()
    }

Issue : Last treeitem is not collapsing. When I see the element in the UI Spy, for the last treeitem "InvokePatternAvailable" property shows false. For last treeitem only Invoke Pattern is not available, for this reason above if condition will not satisfy.

My Question is: Is this correct way to collapse the Infragistics treeitem Or Is there any bug in Infragistics controls?

Haploid answered 12/5, 2017 at 12:22 Comment(5)
Send Enter/ Space Key?Obsidian
@Obsidian Thanks for the suggestion, tried space as well as Enter key, but not workingHaploid
Have you already tried to send this key "-" ?Dextrous
Is there ExpandCollapsePatternAvailable==true?Dogged
@Haploid I also experienced Infragistic controls are buggy quite often in terms of UI automation. If you are able to change the Application Under Test, you might wanna check out my answer to a similar question: #32504650Intolerable

© 2022 - 2024 — McMap. All rights reserved.