exception on button click that closes a dialog

Jan 7, 2010 at 11:15 AM
Edited Jan 7, 2010 at 11:19 AM


the above code clicks 'ok' button closing a dialog and then throws the following exception. could you help me with this

Bricks.BricksException was unhandled
  Message="Error invoking Button.Click"
       at Bricks.RuntimeFramework.ReflectedObject.Invoke(MethodInfo methodInfo, Object[] arguments)
       at Bricks.DynamicProxy.DynamicProxyInterceptors.Process(IInvocation invocation, InterceptContext interceptedContext)
       at White.Core.Interceptors.CoreInterceptor.Intercept(IInvocation invocation)
       at Castle.DynamicProxy.AbstractInvocation.Proceed()
       at ButtonProxy2174a796362b4f80ae4a0432ef38940f.Click()
       at TestAutomation.Test.Main(String[] args) in D:\GE\GeAutomation\src\TestAutomation\Test.cs:line 64
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: White.Core.UIItems.UIActionException
       Message="Window didn't respond, after waiting for 5000 ms"
            at White.Core.UIItems.WindowItems.Window.WaitWhileBusy()
            at White.Core.UIItems.Actions.Action.Handle(Window window)
            at White.Core.UIItems.WindowItems.Window.ActionPerformed(Action action)
            at White.Core.InputDevices.Mouse.ActionPerformed(ActionListener actionListener)
            at White.Core.InputDevices.Mouse.Click(Point point, ActionListener actionListener)
            at White.Core.UIItems.UIItem.PerformClick()
            at White.Core.UIItems.UIItem.Click()
       InnerException: System.ComponentModel.Win32Exception
            Message="Access is denied"
                 at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited)
                 at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
                 at System.Diagnostics.Process.WaitForInputIdle(Int32 milliseconds)
                 at System.Diagnostics.Process.WaitForInputIdle()
                 at White.Core.UIItems.WindowItems.Window.WaitWhileBusy()

Jan 14, 2010 at 8:12 PM

I'm experincing the same behavior.  I have a dialog box with Yes and No buttons.  I get the exception when either button is pressed and the dialog disappers.

I investigated it a little and it seems that the Click() method of the Mouse class does two main things: performs the click and waits for the window to be ready for input again.  But in this case the window does not exist anymore.  The WaitWhileBusy() is invoked on the window instance and the following line of code is executed:


In this case automationElement.Current is the proxy to the window that once existed. In this case it is empty(?) and ProcessId is 0. That is the cause of the exception. The solution whould be to handle the exception in this case.

As I side note, I noticed that I only get this exception on "slow" machines and not fast manchines.

Jan 17, 2010 at 4:47 AM

This bug was reported as soon as 0.19 came out. So instead of creating another release I had to patch it and re-release it.

If you are one of the earliest downloaders you might face this issue, please download it again. I should have release 0.19.1 or something.

Jan 17, 2010 at 3:40 PM

I am sorry to report that the bug is still present in 0.19.

I would be releasing 0.19.1 very soon.....next couple of days, which should fix this issue.

Jan 17, 2010 at 3:54 PM

the fix is available now

Sep 13, 2010 at 1:38 PM

I seem to have the same issue though I both tried the 0.20 binaries as well as building white myself (checked out trunk a few minutes ago). Modal dialog, doing "click()" on the cancel button, closes the dialog but then runs into the timeout and throws an exception..

Failed    TestMethod1    Kernel.Test    Test method Kernel.Test.DesignerStartUp.TestMethod1 threw exception:  Bricks.BricksException: Error invoking Button.Click --->  White.Core.UIItems.UIActionException: Window didn't respond, after waiting for 5000 ms --->  System.Exception: Timeout occured, after waiting for 5000 ms.  

Changing the time out to 10000ms didn't help either. Any hint? Come to think of it... maybe the fix is only in the 0.19 branch? Will try that next...

Any help would be appreciated...



P.S.: Here is what I do:


// Runs as a Visual Studio 2008 test...

White.Core.Application application = White.Core.Application.Launch("..\\..\\..\\ventuz.exe");

// Wait until the launch screen is gone and the main document view appears.
while (application.GetWindow("Ventuz") == null)

White.Core.UIItems.WindowItems.Window mainWindow = application.GetWindow("Ventuz");
White.Core.UIItems.WindowItems.Window openProjectWindow = mainWindow.ModalWindow("Select Project");

Dec 3, 2010 at 9:49 AM

Any help?

Same problem with 0.20 library....

Dec 3, 2010 at 11:32 AM

Haven't made any progress myself and hadn't heard from anyone.  I've stopped trying/debugging a while ago and hadn't had time to have another look since then. I kind of dropped the whole idea after noticing that UIAutomation is great if one only needs keyboard input and menu/button clicking but there is neither a good way to do mouse simulation or even touch simulation.

Jan 11, 2011 at 2:51 PM

Hey , I do not know if it could help you , but I had the same problem with an button . The action took too much time so I created an App.config in my White project, not in the application and it works nice now.




<?xml version="1.0" encoding="utf-8" ?>
    <sectionGroup name="White">
      <section name="Core" type="System.Configuration.NameValueSectionHandler"/>

      <add key="WorkSessionLocation" value="." />
      <add key="PopupTimeout" value="5000" />
      <add key="SuggestionListTimeout" value="10000" />
      <add key="BusyTimeout" value="10000" />
      <add key="WaitBasedOnHourGlass" value="true" />
      <add key="UIAutomationZeroWindowBugTimeout" value="10000" />
      <add key="TooltipWaitTime" value="10000" />
      <add key="DragStepCount" value="4" />