Must set up a break point to close the dialog window

Nov 25, 2009 at 10:53 PM
Edited Nov 25, 2009 at 10:55 PM

Hi all,

I am using White to do automation test on winform application. When I clicked a button, there will be a confirm dialog window ("xxx") pop up

Window

winEzyTicketEmailSent = Desktop.Instance.Windows().Find(dialog=>dialog.Name=="xxx");

I just want to close this dialog window and keep the application going.

I tried three different ways as following: 

1. 

winEzyTicketEmailSent.Focus();

winEzyTicketEmailSent.Close();

2. 

Button btnOKInEzyTicketEmailSent = winEzyTicketEmailSent.Get<Button>(SearchCriteria.ByAutomationId("2").AndByText("OK"));

btnOKInEzyTicketEmailSent.Focus();

btnOKInEzyTicketEmailSent.Click();

3. 

Core.InputDevices.AttachedKeyboard keyEnter = winEzyTicketEmailSent.Keyboard;

keyEnter.PressSpecialKey(Core.WindowsAPI.KeyboardInput.SpecialKeys.RETURN);

 

All these 3 methods work during the step-by-step debug. but it just cannot automatically close the dialog when i run the test case.

Any ideas? Thanks alot in advance.

Nov 26, 2009 at 12:06 AM

I tried the new build 0.19, it works now. however it was strange and any points are appreciated.

Cheers

Coordinator
Nov 29, 2009 at 5:39 AM

Were you getting some exception or it was the just the case of button not being clicked. It great that it is working for you in the white's new release but I have not provided any specific fix around this, not that I know of any issue either.