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