Skip to main content

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 NayashkovaFriend
Messages: 12
Registered: July 2009
Junior Member
In Memory Analyzer ( 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?

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 GrawFriend
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.

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

Current Time: Fri Jun 22 04:01:18 GMT 2018

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

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

Back to the top