Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Externalized Strings in SWTBot: best practices
Externalized Strings in SWTBot: best practices [message #484645] Tue, 08 September 2009 11:23 Go to next message
Elena Nayashkova is currently offline Elena Nayashkova
Messages: 12
Registered: July 2009
Junior Member
Hi,

it's common in SWTBot to search for a particular widget by its text or
label. And, to ensure that your tests don't fail in case those Strings
were changed, it is logical to use the externalized Strings. For your
plugins it is relatively easy to find the location of the keys (e.g. in
message.properties, plugin.properties, etc), but how to find the keys for
the Strings from other plugins, e.g. for Eclipse's menues, dialog labels.
What is your experience in solving this problem?

Best Regards,
Elena.
Re: Externalized Strings in SWTBot: best practices [message #484664 is a reply to message #484645] Tue, 08 September 2009 12:57 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
In our case we don't externalize strings in property files.

We've realized that keeping the tests readable is more important than
reducing code (or string duplication).

We use plain strings in tests. If at all the developers change any UI
that'll break tests we ensure that we update the tests accordingly. Also
we notice if any UI tests break at the end of every check-in as part of
the automated build process.

--
Ketan
http://studios.thoughtworks.com/twist | http://twitter.com/ketanpkr

On 08/09/09 8:53 PM, Elena Nayashkova wrote:
> Hi,
>
> it's common in SWTBot to search for a particular widget by its text or
> label. And, to ensure that your tests don't fail in case those Strings
> were changed, it is logical to use the externalized Strings. For your
> plugins it is relatively easy to find the location of the keys (e.g. in
> message.properties, plugin.properties, etc), but how to find the keys
> for the Strings from other plugins, e.g. for Eclipse's menues, dialog
> labels. What is your experience in solving this problem?
>
> Best Regards,
> Elena.
>
Re: Externalized Strings in SWTBot: best practices [message #484775 is a reply to message #484645] Wed, 09 September 2009 03:31 Go to previous message
Kay-Uwe Graw is currently offline Kay-Uwe Graw
Messages: 24
Registered: July 2009
Junior Member
We always externalize our own application strings because we develop the
application usually at least bilingual. We use the NLS mechanism which
works well with SWTBot as well. We use IDialogConstants in our swt bot
tests to get access to the button labels which are not explicitly set in
our application code (e.g. wizards). Strings from external plugins which
can not be accessed otherwise we usually externalize manually into an
utility class which we use in the swt bot tests.

Kay
Previous Topic:SWTBot Spy Plugin
Next Topic:Select Tree Items Problem
Goto Forum:
  


Current Time: Mon Sep 01 03:49:10 EDT 2014

Powered by FUDForum. Page generated in 0.01816 seconds