0

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.

FredG
  • 104
  • 8
ron
  • 281
  • 2
  • 4
  • 14

2 Answers2

0

SWTBOT can't handle native dialogs - see http://wiki.eclipse.org/SWTBot/FAQ#How_do_I_use_SWTBot_to_test_native_dialogs_.28File_Dialogs.2C_Color_Dialogs.2C_etc.29.3F

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • I could not open a new discussion page or I would tag it as Windowtester. I am working with window tester. Sorry I should mentioned it somewhere. thanks – ron Nov 11 '13 at 16:07
0

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);
BenMorel
  • 34,448
  • 50
  • 182
  • 322
Max Hohenegger
  • 1,609
  • 15
  • 19