Skip to content
Learn with RV – Tech Blog
Learn with RV – Tech Blog

#testautomation #qa #programming #linux #devops

  • Home
  • Who am I?
  • 1-on-1 Mentoring
  • Test Automation Incubator
  • 24 Testimonials
  • YouTube
  • LinkedIn
  • Contact
Learn with RV – Tech Blog

#testautomation #qa #programming #linux #devops

October 17, 2025October 17, 2025

Internationalization (i18n) – in test automation

This approach is about keeping tests stable when the application switches between multiple languages (e.g. romanian, french, english, etc).

Starting with the fact that nowadays applications support multiple languages (which is great for users!), for automation engineers it can quickly turn into a nightmare if the test selectors depend on visible text. This can be avoided by application an internationalization mechanism (i18n) into your automation design.

What is i18n?

The abbreviation i18n stands for internationalization – the number 18 represents the letters between ‘i’ and ‘n’. 
In software, internationalization means preparing your application so it can easily be localized into different languages without changing the source code.

It means:

  • extracting all user-visible texts into separate files (e.g. JSON files)
  • using semantic keys instead of hardcoded text
  • supporting dynamic language changes
  • keeping identical key structures across all languages

Folder structure example

A setup that I personally use is having a /locales folder with .json files like this

locales

Each file contains the same keys but with translated values

The problem with text-based selectors

Let’s imagine your current test locates the login button like this 

await $(‘//android.widget.TextView[@text=”Autentificare”]’).click();

It works fine in Romanian language – but as soon as the app switches to english/french, the visible text changes to “Login” or “Conexxion”.

Conclusion: Your test fails, even though the functionality works perfectly.

The solution

Instead of searching by visible plain text, design your selectors to use i18n keys - the ones defined in our /locales .json files.

For example:
await $(`//android.widget.TextView[@text="${i18n.login.button}"]`).click();

Benefits

Stable tests: changing the UI no longer breaks your tests

Lower maintenance: no need to update text-based locators with every translation update

Cross-locale compatibility: the same suite runs across all supported languages

Conclusion

By adopting i18n approach into your tests, you will create a robust, maintainable, and language-agnostic automation framework.

Post Views: 410

Related

Share this article:
Uncategorized

Post navigation

Previous post
Next post

Recent Posts

  • Cleaner asserts in Grafana k6 load tests using expect
  • AI: What Happens When an AI’s Context Window Gets Full?
  • Upgrading Playwright package to latest version in simple steps
  • Oxfmt tutorial – the Prettier code formatter alternative, 30x faster
  • Configuring testIdAttribute in Playwright

Recent Comments

  1. Paul on Web Accessibility: A step-by-step guide to Testing with pa11y
  2. Automated Tests for website Accessibility with Axe and TestCafe - Learn with RV - Tech Blog on How to generate E2E TestCafe Framework in seconds
  3. RV on Exploring Faker.js: A Powerful Tool for Generating Realistic Random Test Data
  4. Adrian Maciuc on Exploring Faker.js: A Powerful Tool for Generating Realistic Random Test Data
  5. Nick on Cypress vs Playwright vs Testcafe – which framework is faster?

Archives

  • May 2026
  • April 2026
  • March 2026
  • February 2026
  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • March 2025
  • February 2025
  • January 2025
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023

Categories

  • AI
  • k6
  • Linux
  • Programming
  • QA
  • Tools
  • Uncategorized
©2026 Learn with RV – Tech Blog | WordPress Theme by SuperbThemes