Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Custom Widgets
Custom Widgets [message #479176] Mon, 10 August 2009 06:54 Go to next message
Elena Nayashkova is currently offline Elena Nayashkova
Messages: 12
Registered: July 2009
Junior Member
In Memory Analyzer (eclipse.org/mat) we have created several custom
widgets, e.g. a rather complicated custom editor that has its own toolbar.
What should be done in order to write an swtbot test for it?
And the second question is regarding the internationalization. Currently
all the widgets are referenced by local names.

What shall I do if I want to run my UI tests in another locale?

Thanks!
Elena.
Re: Custom Widgets [message #479225 is a reply to message #479176] Mon, 10 August 2009 10:39 Go to previous message
Kay-Uwe Graw is currently offline Kay-Uwe Graw
Messages: 24
Registered: July 2009
Junior Member
One common approach for localization for rcp applications is the use of
the nls mechanism where the specific string values are stored in language
property files and are defined as static fields in a Messages class which
are referenced in your application code. If you use this Messages class
and its fields in your swtbot test code as well you don't have to worry
what the actual values are in the property files. Even if you only
implement your application for one language you should use this mechanism
because if the label values are hardcoded in your swtbot tests your tests
will fail everytime someone changes a label or other string value in the
application code. You could also give all your widgets an id value with
the method setData("IdKey", "WidgetIdValue") in your application code and
than use the widgetById methods in your swtbot test code instead.

For custom widgets you have to write your own SWTBotCustomWidget Wrapper
classes and extend the swtbot class with the corresponding widget finder
methods. Just look at the code of existing wrapper classes and methods and
adapt accordingly. It is pretty straight forward.

Kay
Previous Topic:Documentation - Javadoc, & Snippets
Next Topic:Lack of tree collapse
Goto Forum:
  


Current Time: Sun Sep 21 20:19:09 GMT 2014

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

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