Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1.72 KB

faq.md

File metadata and controls

49 lines (35 loc) · 1.72 KB

FAQ

How can I handle internationalization/localization (i18n/L10n)?

Semantic locators don't yet have built-in support for tests with strong cross-language requirements. In general you'll need a different locator for each locale, as {button 'Hello'} won't find <button>Bonjour</button>. Solutions to localized tests will be specific to your L10n method and test environment, but there are a few general approaches which may work.

One solution is to parameterize tests based on the locale, and get the localized string from an id and locale. A pseudocode example:

function myTest(@Parameter locale):
  submitMsg = readFromTranslationFile("SUBMIT", locale)
  searchButton = findElementBySemanticLocator("{button '" + submitMsg + "'}")

Some libraries (such as Closure ) perform L10n when compiling JavaScript. It may be possible to access L10n APIs from your test and inject the localized strings into locators. For example in Closure:

const searchButton = findElementBySemanticLocator(`{button '${goog.getMsg('Search')}'}`);

Which browsers are supported?

Semantic locators are tested on recent versions of:

  • Chrome
  • Firefox
  • Internet Explorer

Bugs and patches are accepted for other major browsers.

Please add support for XXX language/environment

See the section "Integrating with your tests". If you can't add support yourself for a certain platform, feel free to file an issue on GitHub

I have more questions

Please file an issue on GitHub to get in touch.