开发者

How to test localized UI in ASP.NET WebForms

I am trying to come up with a way to automate testing of localized UI in ASP.NET WebForms. Basically I have button that toggles the current locale and code that populates the right text from resource file. The problem is how to test it.

One approach is to use BDD in a form of

As a Spanish speaking user

I want to switch to Spanish

So that I can use the site more c开发者_Go百科omfortably

Scenario Outline: ... a bunch of steps to get each possible string (labels, buttons, messages, etc)

Another approach is to use TDD in a form of row based tests and check each property (which is WebForms is not trivial).

The first approach forces repeating existing scenarios, the second is very difficult and not clear.

How do people test localization?


Well I am in the same boat at this moment...

What I am trying to do.. is

  • to extract the user-visible strings used by the automated tests out into a swappable block (in my case this is a .net resource file). The idea is to have different machines (or VMs or change at runtime) and run the same suite across different localized versions of the app.
  • That leaves the switch language feature (that we don't support at the moment): that you could test by exercising the switch behavior and doing a cursory check in a test.
  • Finally you really need a set of human eyes to ensure everything has been localized and is accessible (e.g. not clipped and stuff). There are other aspects too that can't be automated.. e.g. the use of colors to signal alarms.
  • To ensure there are no hard coded user-visible strings, create a junk resource file with junk characters, wire it to the app and manually breeze through all the screens periodically (every 2 weeks). If you still see english strings, something still resides out of the resource file. Once everything is in the resource file, you still need someone who speaks the language to ensure that the localized strings appear correctly or match the context in which they are shown.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜