UIAutomation: Getting child control are very slow RRS feed

  • Question

  • Hi guys,

    This question is about UIAutomation (System.Windows.Automation) , not WPF. but I search these forums and found that most of UIAutomation questions are asked here, so I post this here. Apologies if it is not the place.

    I'm using  UIAutomation for software testing at work. It's working well but I found a problem for this one application.

    It loads in around 1-2 seconds, and I am able to get the AutomationElement of its window in around 2 seconds. However the children automationelement of this window is only avalaible in around 10 seconds ( before that windowElement.FindAll(TreeScope.Children, Condition.TrueCondition) always returns an empty collection), even though the actual children controls are already visible in the GUI and the automationelement for the parent window is available long before that.

    The applicaiton is an old Win32 application in my company. The problem is only found with this application so far, UIAutomation works well with other applications

    What could be the cause of this slowness and how to avoid it? Is there a trick to make the children available to UIAutomation faster?

    • Moved by Bob_Bao Monday, December 20, 2010 4:32 AM ui automation (From:Windows Presentation Foundation (WPF))
    Thursday, December 16, 2010 7:15 AM

All replies

  • Hi.

    I don't know to many things about it.

    I'm testing just web applications. First you will need to have a good definition for your objects (unique object properties, good hierarchical tree for parents).

    Second, you can use this: http://blogs.msdn.com/b/gautamg/archive/2009/11/29/how-to-enable -tracing -for-ui-test-components.aspx

    to enable the trace and to check it to see where is the real problem. If you wont find it, you can post the debug trace here, and there are others people that can read it and help you.

    Tuesday, December 21, 2010 7:51 PM
  • Please post the question here http://social.msdn.microsoft.com/Forums/en-US/windowsaccessibilityandautomation/

    As this does not relates to codeduitest.


    Thanks & Regards Siddhartha
    Wednesday, December 22, 2010 7:02 AM