Test Infragistics Tree and Grid

May 28, 2008 at 11:31 AM

I'm new to White Project and have some problems to get started. The application I want to test has some Infragistics controls like UltraTree and UltraGrid. I tried to access them using the code in discussion "Access to Infragistic controls" but the properties of the controls are all null. Am I missing something, is there another way to read these controls? Here is my code:

SearchCriteria treeCriteria = SearchCriteria.ByAutomationId("ultraTree1");
Core.UIItems.TreeItems.Tree tree = myWindow.Get<Core.UIItems.TreeItems.Tree>(treeCriteria);
Core.UIItems.TreeItems.TreeNode node = tree.Node("ANode");

In this case the node is null and node count is 0 although the tree has nodes in the application. The tree object itself is not null but TreeProxy and some numbers.

Could you please give me a hint how to test Infragistics controls?


May 30, 2008 at 5:39 AM
Can you do a window.LogStructure() and send it to me? Most likely these controls are not exposed by UIAutomation as Tree, but I would like to verify it.
May 30, 2008 at 7:43 AM
This is the log to the application:

ControlType: window
Name: Form1
Bounding rectangle: 22,29,302,322
ClassName: WindowsForms10.Window.8.app.0.378734a
IsOffScreen: False

    AutomationId: label1
    ControlType: text
    Bounding rectangle: 119,319,185,20
    ClassName: WindowsForms10.STATIC.app.0.378734a
    IsOffScreen: False

    AutomationId: button1
    ControlType: button
    Name: button1
    Bounding rectangle: 38,319,75,23
    ClassName: WindowsForms10.BUTTON.app.0.378734a
    IsOffScreen: False

    AutomationId: ultraTree1
    ControlType: tree view
    Bounding rectangle: 38,71,268,242
    ClassName: WindowsForms10.Window.8.app.0.378734a
    IsOffScreen: False

    AutomationId: TitleBar
    ControlType: title bar
    Name: Form1
    Bounding rectangle: 26,33,294,26
    IsOffScreen: False

        AutomationId: Form1
        ControlType: menu bar
        Name: System Menu Bar
        Bounding rectangle: 26,33,18,25
        IsOffScreen: False

            AutomationId: Item 1
            ControlType: menu item
            Name: System
            Bounding rectangle: 26,33,18,25
            IsOffScreen: False

        AutomationId: Minimize
        ControlType: button
        Name: Minimize
        Bounding rectangle: 248,33,24,24
        IsOffScreen: False

        AutomationId: Maximize
        ControlType: button
        Name: Maximize
        Bounding rectangle: 272,33,24,24
        IsOffScreen: False

        AutomationId: Close
        ControlType: button
        Name: Close
        Bounding rectangle: 296,33,24,24
        IsOffScreen: False
Oct 22, 2008 at 10:08 AM
What should I make, that I could get access to UltraGrid and UltraTree?
Oct 25, 2008 at 7:37 PM
White's (rather UIAutomation) support for Infragistics controls is not very good. While it works on certain versions of OS it doesn't on other. The reason being the UIA doesn't supply AutomationElements within Tree, which is the reason you cannot see the nodes.
I intend look into the issue, and provide some kind of support in future by bypassing UIA for it.
Oct 26, 2008 at 3:46 PM
Edited Oct 26, 2008 at 3:48 PM
Thanks. When do you plan to add this function? Advise, what is it possible to test UltraGrid and UltraTree?
Oct 26, 2008 at 6:56 PM
UIAutomation doesn't offer a solution at this point, which means white doesn't as well in this case.
You might still want to try this out on different machines, because I am able to test UltraGrid on my machine.
Oct 26, 2008 at 7:43 PM
This is my code:

Table table = window.Get<Table>("ultraGrid1");
int numberOfCustomers = table.Rows.Count;

I can get table. But  when i try get rows, test failed.

Error: Log4Net not configured. Looked for file: D:\work\MESware\WhiteTest\WhiteTest\bin\Debug\log4net.config
Section: Bricks in SectionGroup: Bricks is not configured in Configuration file
Using RecheckDurationInMilliseconds=100 for Bricks/Bricks
TestCase 'WhiteTest.Class4.Test1'
failed: Bricks.BricksException : Error invoking Table.get_Rows
  ----> System.NullReferenceException : Object reference not set to an instance of an object.
    D:\bricks\Bricks.RuntimeFramework\ReflectedObject.cs(69,0): at Bricks.RuntimeFramework.ReflectedObject.Invoke(MethodInfo methodInfo, Object[] arguments)
    D:\bricks\Bricks\DynamicProxy\DynamicProxyInterceptors.cs(20,0): at Bricks.DynamicProxy.DynamicProxyInterceptors.Process(IInvocation invocation, InterceptContext interceptedContext)
    d:\white-os\Core\Interceptors\CoreInterceptor.cs(29,0): at Core.Interceptors.CoreInterceptor.Intercept(IInvocation invocation)
    d:\OSS\Castle\Tools\Castle.DynamicProxy2\Castle.DynamicProxy\AbstractInvocation.cs(165,0): at Castle.DynamicProxy.AbstractInvocation.Proceed()
    at TableProxy67a7e54e76ad43ff8afa6b984c906575.get_Rows()
    D:\work\MESware\WhiteTest\WhiteTest\Class4.cs(41,0): at WhiteTest.Class4.Test1()
    d:\white-os\Core\UIItems\UIItem.cs(35,0): at Core.UIItems.UIItem..ctor(AutomationElement automationElement, ActionListener actionListener)
    d:\white-os\Core\UIItems\TableItems\TableHeader.cs(13,0): at Core.UIItems.TableItems.TableHeader..ctor(AutomationElement automationElement, ActionListener actionListener)
    d:\white-os\Core\Factory\TableHeaderFactory.cs(12,0): at Core.Factory.TableHeaderFactory.Create(AutomationElement automationElement, ActionListener actionListener)
    d:\white-os\Core\UIItems\TableItems\Table.cs(39,0): at Core.UIItems.TableItems.Table.get_Header()
    d:\white-os\Core\UIItems\TableItems\Table.cs(29,0): at Core.UIItems.TableItems.Table.get_Rows()
Nov 1, 2008 at 1:44 PM
There is nothing wrong in the code. There is inconsistency in the way UIA behaves.
In other discussions there have been ideas about how to solve it. e.g. one of them is you locate items using position. Such approach would lead to bad quality of tests at this point.
I would have to try out if white can make this better somehow.
Since I need get into UIA code and figure out what is going wrong this might take a while.
Mar 9, 2009 at 10:30 AM

Can I help?

I have extensive experience of unit testing and GUI testers such as WaitN and want to try White.  Unfortunately I am working on a legacy project that uses Infragistics tree and grid controls heavily.  We get the same problem as sischmidt.  As it always happens (with White 0.17) I may be in a better position than viveksingh to investigate.

However I don't want to duplicate someone else's work.  viveksingh how far have you got with this problem?  Can you give me any pointers to where in the White source code I should be looking?

David A Taylor

Mar 11, 2009 at 4:21 AM
Hey thanks for offering. I would love all the help I can get.
On this issue itself, I have been responding to people more on the lines like whether a thirdparty control is supported by UIA (hence White) or not.
Having said this, one needs to create custom ui item in white to support these. If I had all the time in the world, I would have started a WhiteContrib project where such support can be provided.
What do you and others think?
Mar 17, 2009 at 5:37 PM
I think it's a great idea. 

I know it would help me out a lot, because we use DevExpress grid frequently.
Mar 25, 2009 at 8:35 AM
I would like to second mockler.  I see a lot of value in this for my work and other users too.

The WhiteContrib project is a good idea too.  It could generate additional support within the White community.
Jul 28, 2011 at 12:22 PM

Hello .

With WHITE.020 I encountered to the same problem of recognizing WPFTreeNode of UltraTree .

I'm trying to use SharpDeveloper , which is use Infragistics2.Win.UltraWinTree.v8.3 contol .

When tried following code :

    TreeNode treeNodeTREE = ultraTree.Get<TreeNode>(SearchCriteria.ByText("Miscellaneous"));  


      or following =>  WPFTreeNode wpfTreeNodeTREE = ultraTree.Get<WPFTreeNode>(SearchCriteria.ByText("Miscellaneous"));

I've got exception: Object reference not set to an instance of an object.

If I try to find TreeNode not from tree , but from window object , like

TreeNode treeNodeWin1 = stMainWindow.Get<TreeNode>(SearchCriteria.ByText("Miscellaneous"));  OR     

WPFTreeNode wpfTreeNodeWin1 = stMainWindow.Get<WPFTreeNode>(SearchCriteria.ByText("Miscellaneous"))

 using  treeNodeWin1.Click or Expand in both case lead to exeption .

Could you please advice , how can I Use WHITE with the UltraWingTree ?

Regards , Alexander.




Jul 29, 2011 at 6:21 AM


          I am new in White, i am using White(0.19), At run time i got one exception as mention as in below.can any one help me.

NonComVisibleBaseClass was detected
Message: A QueryInterface call was made requesting the class interface of COM visible managed class 'MS.Internal.AutomationProxies.WindowsEditBox'. However since this class derives from non COM visible class 'MS.Internal.AutomationProxies.ProxyHwnd', the QueryInterface call will fail. This is done to prevent the non COM visible base class from being constrained by the COM versioning rules.

Aug 4, 2011 at 6:46 AM
Edited Aug 4, 2011 at 6:50 AM


               I using White 0.19 version,In my Project PopUpMenuBar and buttons,labels,text box,drop down list ,check boxes are there   In Side the Grid Control.

plz tel me how can i  Identify the  controls in side the grid  and Po Pup menu bar in White?


thanks and regards,


Jan 6, 2012 at 10:34 AM

Hi, azheleznyak,

Hi viveksingh,

I think I've found why you have this error.

I don't know why, but when trying to map the infragistics tree node control with a White tree node type, the call to the method controlDictionary.GetTestControlType is made with isNativeControl being false, even if the infragistics control is based on Winform. The className is empty as well.

The result is that the tree node is recognized as a WPFTreeNode, and when you call Click on it, there's a NullPointerException, because it's not a WPF control at all.

The thing is the treeview itself is recognized as a native and WinForm control (frameworkId)

Finally, even with a Win32TreeNode (after recompiling White code), the doubleclick on it doesn't work !