i18n testing using selenium

2019-08-04 22:59发布

问题:

Have any one used selenium for testing i18n !

Does Selenium provide any kind of I18N/L10N support? Is it possible to verify text based on message keys from a resource file? What about checking numbers and dates that might have a different format because of L10N?

回答1:

I am also interested in the correct approach for this issue. Where I work, we usually use the ids to verify certain page or field. But, sometimes you might need to verify some text, which could be using i18n.

Try the following:
If you have a selenium-testing module, have the module where the bundle is placed as a dependency. And then define a ReloadableResourceBundleMessageSource in the xml. And than setup the test following this code: https://stackoverflow.com/a/6251478/521754

Hope that helps!
Cheers!