Tree selection is not working for node whose parent node has large number of children

May 22, 2012 at 3:33 PM

Hi ,

I am using white for my UI automation. I have a large tree as given below










Node1 has one child Node2

Node2 has 1000 children


The tree is already expanded and tree is visible till childNode20 from start in the view.When i try to call TreeHandle.Node(); The tree start fluctuating (Size scrollbar start moving) and finaly fails.


My code is

var nodePath=@"Node1\Node2\ChildNode1";

var  TreeHandle = mainWindow.Get<Tree>(AutomationIdOfTree);

var node= TreeHandle.Node(nodePath.Split('\\'));

It is failing in step3 which is have marked green.

This code is working fine with small trees.


I tried to debug the source code and i found that when i am calling TreeHandle.Node() it is internally calling Nodes.GetItem(nodePath);

And in GetItem there is one function called node.Expand();

inside that it is calling actionListener.ActionPerforming(this);

inside that it is calling ScreenItem(uiItem, ScrollBars).MakeVisible(this);

now inside MakeVisible function it is scrolling the scroll-bar till verticalSpan.DoesntContain(bounds) become true.

Now inside that function it is trying to bring the BoundingRectangle of my

Node1 inside start and end of VerticalSpan and since bounding rectangle is very large it not able to bring that inside VerticalSpan limit. So it is giving time out.


So  is there any way to fix this issue without changing the tree.







May 25, 2012 at 7:50 PM


I know this problem too. We have contact MIcrosoft with this problem, It's a problem in UIAutomation. This Problem occours if a Node in tree is already selected. Use SelectionPattern for this node to remove it from selection and try again.