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?

Danko Valkov
  • 1,038
  • 8
  • 17
User
  • 804
  • 8
  • 22
  • Send Enter/ Space Key? – kurakura88 May 15 '17 at 05:42
  • @kurakura88 Thanks for the suggestion, tried space as well as Enter key, but not working – User May 15 '17 at 05:56
  • Have you already tried to send this key "-" ? – Maxwell77 May 19 '17 at 10:09
  • Is there `ExpandCollapsePatternAvailable==true`? – Vasily Ryabov Jun 01 '17 at 20:47
  • @User 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: https://stackoverflow.com/questions/32504150/msaa-ui-automation-get-accchildcount-incorrectly-returning-0-for-infragistics-ul/32521788#32521788 – Haphil Mar 13 '18 at 21:36

0 Answers0