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

desired_caps = {
    'browserstack.timezone': 'UTC'
}
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("browserstack.timezone", "UTC");
desired_cap = {
	'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");

Note: Timezone feature 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

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

desired_caps = {
    'locale': 'fr_CA'
}
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("locale", "fr_CA");
desired_cap = {
	'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");

We're sorry to hear that. Please share your feedback so we can do better







Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better







Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Talk to an Expert