Support for native windows dialogs

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

Support for native windows dialogs

Postby knarayan » Fri Sep 26, 2008 12:15 am

Hello,
I'm currently in the process of evaluating Window Tester Pro and I downloaded the latest Evaluation Copy and am trying to test an Eclipse "Plugin" - I'm having the following issue and I think I've seem some comments surrounding this on the forum but was hoping for some more information:

- Is there a way to dismiss a "standard" windows dialog message box (Our plugin throws an error message in a standard windows dialog message and I'm unable to dismiss it - I tried to use the ui.keyClick(WT.CR) as the Dialog seems to be the "active" dialog so I was hoping to work around the issue by simply typing the "enter" key but that was not working either.

Since I just started looking at this product, I was hoping to get some guidance. Thank you!

- Kesavan
Attachments
untitled.PNG
Dialog Box I'm trying to dismiss
untitled.PNG (15.24 KiB) Viewed 928 times
knarayan
 
Posts: 7
Joined: Fri Sep 26, 2008 12:06 am

Re: Support for native windows dialogs

Postby Phil Quitslund » Fri Sep 26, 2008 11:59 am

The carriage return should work... but possibly you are dispatching it before the Dialog is ready for input?

As a quick test, you might put a healthy artificial pause before the keystroke. For example:

Code: Select all
ui.pause(3000);     //wait 3 seconds --- TODO: replace with a condition!
ui.keyClick(WT.CR); //dismiss


How does this fare?

Also, do you know when this dialog will show up or is it unpredictable?
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Support for native windows dialogs

Postby knarayan » Fri Sep 26, 2008 11:47 pm

Hi Phil,

Thanks!
It is predictible - it occurs whenever we do our custom project creation.
Also, I tried what you suggested and it may be that I'm using a ShellDisposeCondition and ShellShowCondition on the the project creation dialog that seems to loose focus by the WARNING dialog message popping up that I send a screen shot of in the initial thread. When doing this manually I select "FINISH" in the project creation dialog and that dialog looses focus and the warning message box pops up (with the project creation dialog righ behind it with no focus) and selecging "OK" to dismiss the warning results in SUCCESSFUL project creation (it's that dismissal that's still my problem):



ui.click(new ButtonLocator("&Finish"));
ui.wait(new ShellShowingCondition("project.creation.dialog"));
ui.wait(new ShellDisposedCondition("project.creation.dialog"), 10);

ui.pause(3000); //wait 3 seconds --- TODO: replace with a condition!
ui.keyClick(WT.CR); //dismiss


Thanks in advance for you help!


- Kesavan
knarayan
 
Posts: 7
Joined: Fri Sep 26, 2008 12:06 am

Re: Support for native windows dialogs

Postby knarayan » Sat Sep 27, 2008 12:01 am

By the way - that dialog box was actually:
org.eclipse.swt.widgets.MessageBox

Maybe I could handle it by using a Locate Widget and dismissing it?

- Kesavan
knarayan
 
Posts: 7
Joined: Fri Sep 26, 2008 12:06 am

Re: Support for native windows dialogs

Postby knarayan » Fri Oct 03, 2008 4:00 pm

Hi Phil,

So i got it to work - and figured out the issue why keyClick was not working for me before:
- I had the project creation dialog get superimposed by the dialog I had given a screen shot of - this created a timeout waiting for the window underneath the "OK" dialog box. Once I removed the following:
ui.wait(new ShellShowingCondition("project.creation.dialog"));

The expected dismissal using typed keys WORKED!

ui.pause(60000); //wait 3 seconds --- TODO: replace with a condition!
ui.keyClick(WT.CR);

Thanks for your help. I'll try replacing the pause with the condition now as well.

- Kesavan
knarayan
 
Posts: 7
Joined: Fri Sep 26, 2008 12:06 am

Re: Support for native windows dialogs

Postby Phil Quitslund » Tue Oct 07, 2008 9:26 am

Good deal.

Thanks for following up!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest