window.Get throwing exception when accessing Name of existing control

Jul 22, 2009 at 11:23 PM
Edited Jul 22, 2009 at 11:26 PM

Guys, I am facing a problem when accessing a name of a control that was rendered a long time ago in my UI. The only thing that happened was a short time since it becomes enabled, and a click was made (another button was clicked)

I created this methods to avoid the error:

public static void WaitTillControlIsFound(this Window window, string controlName)


    () =>
        IUIItem item = null;
        item = window.Get(SearchCriteria.ByAutomationId(controlName));
    catch { }
        return item != null;

I know it sucks, but it is the only way I could avoid the error.

Repository.Interceptors.UIItemInterceptor.Intercept(IInvocation invocation) in d:\white\Repository\Interceptors\UIItemInterceptor.cs: line 36
Castle.DynamicProxy.AbstractInvocation.Proceed() in d:\OSS\Castle\Tools\Castle.DynamicProxy2\Castle.DynamicProxy\AbstractInvocation.cs: line 165

Thank you, Felipe Lopes



Sep 20, 2009 at 6:25 AM

For some reason I never saw this message, my apologies.

What makes your control enabled?