javaswtswtbotwindow-tester

Access windows native message dialog box windowtester


I am a new to this. I am working on WindowTester.I could not open a new discussion page or I would tag it as Windowtester I am having difficulty of closing down windows native dialog box after pull down menu. The code is,

ui.click(new PullDownMenuItemLocator("Save Control ", new ViewLocator("com.SOAGateway.control.views.SOAGView")));

After choosing one of the option from the menu, a dialog box appear which is native window dialog. I would like to cancel it but it is not working. I tried different things such as,

a)

ui.click(new PullDownMenuItemLocator("Save Control ", new    ViewLocator("com.SOAGateway.control.views.SOAGView")));
Display display = new Display();
if (shell != null) shell.dispose();

b)

Display display = new Display();
ui.click(new PullDownMenuItemLocator("Save Control ", new ViewLocator("com.SOAGateway.control.views.SOAGView")));
display.dispose();

But nothing is working.

Is there any idea how could I sort out this problem. Thanks.


Solution

  • Interaction with native Dialogs is very limited in Windowtester. However, you should be able to cancel a native dialog in Windows with the following line of code:

    ui.keyClick(WT.ESC);