Set localization options

To test a localized version of your app, you can configure timezone, language and locale for your Appium tests.

Timezone

You can set the device timezone in order to configure your tests to run on a custom timezone.

Capability Description Values
browserstack.timezone Configure tests to run on a custom time zone. Example:
New_York (for America/New_York)
Los_Angeles (for America/Los_Angeles)
La_Rioja (for America/Argentina/La_Rioja)
You can view the complete list of timezones on wikipedia.

Example

DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("browserstack.timezone", "UTC");
var capabilities = {
	'browserstack.timezone': 'UTC'
}
DesiredCapabilities capability = new DesiredCapabilities();
capability.SetCapability("browserstack.timezone", "UTC");
$capabilities = new DesiredCapabilities();
$capabilities->setCapability("browserstack.timezone", "UTC");
desired_cap = {
	'browserstack.timezone': 'UTC'
}
desired_caps = {
    'browserstack.timezone': 'UTC'
}
Note: Setting device timezone is only supported on Android

Language

In order to test the localized version of your app, you can set a language using Appium’s language capability. This capability will only affect the application under test and not the device.

Capability Description Values
language Set the language of the app under test. Example: ‘fr’

Example

DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("language", "fr");
var capabilities = {
	'language': 'fr'
}
DesiredCapabilities capability = new DesiredCapabilities();
capability.SetCapability("language", "fr");
$capabilities = new DesiredCapabilities();
$capabilities->setCapability("language", "fr");
desired_cap = {
	'language': 'fr
}
desired_caps = {
    'language': 'fr'
}

Locale

In order to test the localized version of your app, you can set the device locale using Appium’s locale capability.

Capability Description Values
locale Set locale for iOS and Android. Android: CA format (country name abbreviation)
iOS: fr_CA format

Example

DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("locale", "fr_CA");
var capabilities = {
	'locale': 'fr_CA'
}
DesiredCapabilities capability = new DesiredCapabilities();
capability.SetCapability("locale", "fr_CA");
$capabilities = new DesiredCapabilities();
$capabilities->setCapability("locale", "fr_CA");
desired_cap = {
	'locale': 'fr_CA'
}
desired_caps = {
    'locale': 'fr_CA'
}
Note: Timezone, language and locale features for app testing is only available with a BrowserStack Paid plan. View details.