Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » FileDialog support in SWTBot(How it is going on?)
FileDialog support in SWTBot [message #641555] Fri, 26 November 2010 03:51 Go to next message
JayRey  is currently offline JayRey Friend
Messages: 5
Registered: November 2010
Junior Member
I have now used SWTBot to construct my test on RCP,but I could not use FileDialog in SWTBot,I have looked into this and found it was not supported.And I'd like to whether the native dialogs such as FileDialog and ColorDialog are supported already and if it is not how can I get the FileDialo with other ways.
Re: FileDialog support in SWTBot [message #641582 is a reply to message #641555] Fri, 26 November 2010 08:29 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 865
Registered: July 2009
Location: Grenoble, France
Senior Member

Le 26/11/2010 04:51, JayRey a écrit :
> I have now used SWTBot to construct my test on RCP,but I could not use
> FileDialog in SWTBot,I have looked into this and found it was not
> supported.And I'd like to whether the native dialogs such as FileDialog
> and ColorDialog are supported already and if it is not how can I get the
> FileDialo with other ways.

http://wiki.eclipse.org/SWTBot/FAQ#How_do_I_use_SWTBot_to_te st_native_dialogs_.28File_Dialogs.2C_Color_Dialogs.2C_etc.29 .3F


--
Mickael Istria -- BonitaSoft S.A.
http://www.bonitasoft.com/products/BPM_download.php
Re: FileDialog support in SWTBot [message #641597 is a reply to message #641582] Fri, 26 November 2010 09:13 Go to previous messageGo to next message
JayRey  is currently offline JayRey Friend
Messages: 5
Registered: November 2010
Junior Member
Thanks,so it can not be supported.And is there any other solution for this,for In many cases,the FileDialog is necessary.
Re: FileDialog support in SWTBot [message #641624 is a reply to message #641597] Fri, 26 November 2010 11:19 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 865
Registered: July 2009
Location: Grenoble, France
Senior Member

A common solution is to have a flag in your application to know whether you are in test mode or not. In your business code, when you are in test, you display an SWT Mock of the Dialog. Then you can use SWTBot on your mock dialog.
But this requires you to change your application code for test purpose...

--
Mickael Istria -- BonitaSoft S.A.
http://www.bonitasoft.com/products/BPM_download.php
Re: FileDialog support in SWTBot [message #641665 is a reply to message #641624] Fri, 26 November 2010 15:09 Go to previous message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
I'd once used AspectJ for such things. Here's a small snippet that
returns a filename from the FileDialog.open call.

https://gist.github.com/149021

--
Ketan
ketan.padegaonkar.name | eclipse.org/swtbot | @ketanpkr

On 11/26/10 4:49 PM, Mickael Istria wrote:
> A common solution is to have a flag in your application to know whether
> you are in test mode or not. In your business code, when you are in
> test, you display an SWT Mock of the Dialog. Then you can use SWTBot on
> your mock dialog.
> But this requires you to change your application code for test purpose...
>
Previous Topic:SWTBot cannot handle login dialog
Next Topic:GEF - activating palette tool
Goto Forum:
  


Current Time: Fri Apr 19 04:26:01 GMT 2024

Powered by FUDForum. Page generated in 0.02073 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top