exception on clicking button

Aug 8, 2011 at 8:36 AM

Hi,

I am trying to automate my WPF application using White.

Following is the code


Application app = Application.Launc(applicationPath);
White.Core.UIItems.WindowItems.Window myUI = app.GetWindow(appPath); 

var newButton = myUI.Get<Button>("New"); 

newButton.Click();

The button is of type

ActiProControls:PopupButton

White is able to find the button and click it but once it clicks it I get following error

White.Core.UIItems.UIActionException was unhandled by user code
  Message=Window didn't respond, after waiting for 60000 ms
  Source=White.Core
  StackTrace:
       at White.Core.UIItems.WindowItems.Window.WaitForWindow() in c:\white\Components\Core\Source\UIItems\WindowItems\Window.cs:line 168
       at White.Core.UIItems.WindowItems.Window.WaitWhileBusy() in c:\white\Components\Core\Source\UIItems\WindowItems\Window.cs:line 138
       at White.Core.UIItems.Actions.Action.Handle(Window window) in c:\white\Components\Core\Source\UIItems\Actions\Action.cs:line 20
       at White.Core.UIItems.WindowItems.Window.ActionPerformed(Action action) in c:\white\Components\Core\Source\UIItems\WindowItems\Window.cs:line 185
       at White.Core.InputDevices.Mouse.ActionPerformed(ActionListener actionListener) in c:\white\Components\Core\Source\InputDevices\Mouse.cs:line 166
       at White.Core.InputDevices.Mouse.Click(Point point, ActionListener actionListener) in c:\white\Components\Core\Source\InputDevices\Mouse.cs:line 161
       at White.Core.UIItems.UIItem.PerformClick() in c:\white\Components\Core\Source\UIItems\UIItem.cs:line 222
       at White.Core.UIItems.UIItem.Click() in c:\white\Components\Core\Source\UIItems\UIItem.cs:line 216
  InnerException:
       Message=Timeout occured, after waiting for 60000 ms
       Source=White.Core
       StackTrace:
            at White.Core.UIItems.WindowItems.Window.WaitForWindow() in c:\white\Components\Core\Source\UIItems\WindowItems\Window.cs:line 151
       InnerException:

Can somebody please help.

 

Coordinator
Aug 16, 2011 at 4:48 PM

Does this happen only when you click on the button or when you do other action as well.

Sep 2, 2011 at 7:12 AM

Hi,

This happens on most of the actions like selecting combobox, menu , menuItem etc

I tried to do

Application app = Application.Launc(applicationPath);
White.Core.UIItems.WindowItems.Window myUI = app.GetWindow(appPath); 

var newButton = myUI.Get<Button>("New"); 

//newButton.Click(); commented code

((InvokePattern)newButton.AutomationElement.GetCurrentPattern(InvokePattern

 

.Pattern)).Invoke();

this works fine.

 why is that so?

 

 

Sep 12, 2011 at 9:02 AM

Hi,

From my tests, I think you should focus on the window that displays the button to be able to click on it without an exception.

Hope that helps,

Itzik