Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Can I test Dialogs in swtbot
Can I test Dialogs in swtbot [message #485054] Thu, 10 September 2009 07:52 Go to next message
Michelle Davidson is currently offline Michelle Davidson
Messages: 41
Registered: August 2009
Member
Hello,

In my RCP I have some MessageDialogs and some Dialogs which extend the Class TitleAreaDialog.

Now I have read, that there is no chance to test native dialogs.

Are TitleAreaDialogs nativeDialogs too?

And how can I test the messagedialog or what can I do to close the messageDialog with ok or cancel?
Re: Can I test Dialogs in swtbot [message #485064 is a reply to message #485054] Thu, 10 September 2009 08:54 Go to previous message
Pascal G is currently offline Pascal G
Messages: 157
Registered: July 2009
Senior Member
Michelle Davidson wrote:
> Hello,
>
> In my RCP I have some MessageDialogs and some Dialogs which extend the
> Class TitleAreaDialog.
> Now I have read, that there is no chance to test native dialogs.
> Are TitleAreaDialogs nativeDialogs too?
> And how can I test the messagedialog or what can I do to close the
> messageDialog with ok or cancel?

Message dialogs are not native dialogs. A good example of a native
dialog is a file chooser: it is the same in eclipse then anywhere else
in your OS.

To test a message dialog, simply search for a shell with the appropriate
title: SWTBot#shell(String). Then, search anything you need inside that
shell:
SWTBotShell shell = bot.shell("foo");
SWTBot childBot = new SWTBot(shell.widget);
childBot.button();
etc.

Hope this helps.
--
Pascal GĂ©linas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/

*Because performance matters.*
Previous Topic:SWTBot test case as Eclipse Product
Next Topic:Blank screen while running SWTBot tests
Goto Forum:
  


Current Time: Sat Aug 30 18:23:51 EDT 2014

Powered by FUDForum. Page generated in 0.01459 seconds