Use localization options for XCUI tests
Test localized version of your app by changing the language, locale, and timezone settings for your XCUI test executions on BrowserStack App Automate.
Localization settings let you verify how your app behaves for users in different regions. Before a build runs, set the device language, locale, and timezone so your XCUITest cases execute in the target environment.
Language
In order to test the localized version of your app, you can change the language of the application under test. This doesn’t affect the language of the device. In order to do so, you need to pass the language parameter in the REST API request to start XCUI test execution.
REST API endpoint:
| Parameter | Description | Values |
|---|---|---|
language |
Set the language of the app under test. |
Example: fr (for French) |
Example cURL request:
Locale
In order to test the localized version of your app, you can set a device locale. In order to do so, you need to pass the locale parameter in the REST API request to start XCUI test execution.
REST API endpoint:
| Parameter | Description | Values |
|---|---|---|
locale |
Set locale |
Example: fr_CA (for French-Canada) |
Example cURL request:
Ensure that your tests are using the ProcessInfo object that includes arguments for setting language and locale when you use the above-mentioned parameters for language or locale. Refer to the following code snippet in Swift language.
-
languageandlocalechange settings at an app level -
To ensure application under test uses localized strings and displays dates, times, and calendar in an appropriate format, pass both
languageandlocalein Capabilities -
Language and locale features are only available with a BrowserStack Paid plan. You can check the App Automate pricing plans.
Related topics
-
Manage your uploaded app or test suite using our upload app REST API and upload test suite REST API.
-
Use the get app API endpoint and list test suites API endpoint to list your recently uploaded apps and test suites.
-
Delete your uploaded app or test suite using the delete app API endpoint and delete test suite API endpoint.
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
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!