Test your app for specific language and region settings

For information on what language and region settings are and why they are important, see apple documentation.

Traditionally, to test an application under customized language and region settings, you would need to perform manipulations of the device Settings application to traverse the different screens and select the correct language and region setting.

This created a lot of overhead for the tester.

  • Changing the device language/region cannot be automated.
  • Doing it manually takes time.
  • Test suites needed to be separated for each different language-region combination. 

Now, Apple provides a way for developers to run XCUITest while the tested application acts like the device is set to customize language and region.

When creating an automation script in Appium for an iOS device that runs the XCUITest Framework, all you need to do is set the language and locale capabilities as part of the DesiredCapabilities object passed to the driver. Both language and locale expect a ‘locale identifier’ as a value.

Copy
capabilities.setCapability("language", "es"); // language is Spanish
capabilities.setCapability("locale", "es_UY"); // region is Spanish (Uruguay)

Keep in mind that these capabilities only affect the tested application and not the actual device setting or any other app (the tested application is the one specified by the bundleId capability).

Note:

Supported from Perfecto release 18.2.