Coded UI: Playback is very slow when traversing large trees
-
Tuesday, March 09, 2010 12:44 AM
I have a rather large WinTree object that I am trying to traverse. From the root down to the final descendants, there are nearly 500 WinTreeItem objects in the tree. Given the size of the tree, I am trying to avoid capturing every last node into the UIMap. Instead I captured the WinTree object and the root WinTreeItem (and consequently all their ancestors). From there, I create a new control for each child node of the root as they need to be referenced.
Playback has no problem finding the root WinTreeItem object. The dynamically created controls that reference its children and grandchildren take approximately 20 seconds each to be located. The root is at depth 0 and each target object is at a depth of 3. So it currently takes a full minute of search time for each WinTreeItem to be located. This seems unusually slow when considering how quickly the other objects are found.
Is it possible to speed up the search process?
All Replies
-
Tuesday, March 09, 2010 3:52 AMModeratorHi,
Can you share your code so that we can see how you can optimize the code?
Please give the search condition and container for the tree also.
Thanks
Siddhartha -
Tuesday, March 09, 2010 5:56 PM
Of course; here is the parent window of the tree object:
ReportTreeWindow
#region Search Criteria
this.SearchProperties[WinWindow.PropertyNames.ControlName] = "reportTree";
#endregion
These are the fully qualified paths (with search criteria) of the WinTree and the root WinTreeItem:
WinTree reportDescTree = irvWindow.ReportUIWindow.ReportTreeWindow.ReportDescTree;
#region Search Criteria
this.SearchProperties[WinTree.PropertyNames.Name] = "Report Description:";
#endregion
WinTreeItem ReportsItem = irvWindow.ReportUIWindow.ReportTreeWindow.ReportDescTree.ReportsTreeItem;
#region Search Criteria
this.mReportsTreeItem.SearchProperties[WinTreeItem.PropertyNames.Name] = "Reports";
this.mReportsTreeItem.SearchProperties["Value"] = "0";
#endregionThis is a child of the root:
WinTreeItem ReportProduct = new WinTreeItem(ReportsItem);
#region Search Criteria
ReportProduct.SearchProperties[WinTreeItem.PropertyNames.Name] = report.Product;
#endregionThis is a grandchild of the root:
WinTreeItem ReportCategory = new WinTreeItem(ReportProduct);
#region Search Criteria
ReportCategory.SearchProperties[WinTreeItem.PropertyNames.Name] = report.Category;
#endregionThis is a great grandchild of the root and the target object:
WinTreeItem ReportName = new WinTreeItem(ReportCategory);
#region Search Criteria
ReportName.SearchProperties[WinTreeItem.PropertyNames.Name] = report.Name;
#endregion
The actual code from this point is just a series of mouse clicks:
Mouse.Click(ReportProduct);
if (ReportProduct.Expanded == false)
ReportProduct.Expanded = true;
Mouse.Click(ReportCategory);
if (ReportCategory.Expanded == false)
ReportCategory.Expanded = true;
Mouse.DoubleClick(ReportName); -
Wednesday, March 10, 2010 4:16 AMModerator
Hi,
Thanks for the code.
Does these dynamic tree item you defined has any search configuration defined? Something like SearchConfiguration.NextSibling? Also if you just for testing add reprotproduct tree item using UICL do you see any difference if the search properties generated by codeduitest as compared to yours? If yes you need to match what is getting generated.
if the above stuff doesnt work can you share the logs with us so that we can get any hint? Also one more thing you should also add searchconfiguration of ExpandWhileSearch for the dynamic tree item so that the Engine internally expand the parent tree item before searching the Treeitem
Thanks
Siddhartha- Proposed As Answer by Siddhartha Pandey - MSFTMicrosoft Employee, Moderator Wednesday, March 10, 2010 4:16 AM
- Marked As Answer by Jonathan_W Wednesday, March 10, 2010 4:51 PM
-
Wednesday, March 10, 2010 4:51 PMNo problem, thanks for the assistance.
Adding the SearchConfiguration.NextSibling appears to have resolved the performance issue. Thank you for the help, it is very much appreciated.

