Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & App Percy

Set Localization Options

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

Language

In order to test the localized version of your app, you can change the language of the application under test (It 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 :

POST /app-automate/xcuitest/v2/build
Parameter Description Values
language Set the language of the app under test. Example: fr (for French)

Example cURL request :

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/xcuitest/v2/build" \
-d '{"language": "fr", "devices": ["iPhone 8 Plus-11.0"], "app": "bs://f5L3azt9pLzE995f49376eb1fa3c284dc321f8d", "testSuite": "bs://6eb1fa3c284ddbe9971b2d1aee0d52943b9c081"}' \
-H "Content-Type: application/json"


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 :

POST /app-automate/xcuitest/v2/build
Parameter Description Values
locale Set locale Example: fr_CA (for French-Canada)

Example cURL request :

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/xcuitest/v2/build" \
-d '{"locale": "fr_CA", "devices": ["iPhone 8 Plus-11.0"], "app": "bs://f5L3azt9pLzE995f49376eb1fa3c284dc321f8d", "testSuite": "bs://6eb1fa3c284ddbe9971b2d1aee0d52943b9c081"}' \
-H "Content-Type: application/json"
Note: 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.
let app = XCUIApplication()
app.launchArguments += ProcessInfo().arguments
app.launch()
Note:
  • language and locale change 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 language and locale in desired capabilities
  • Language and locale features are only available with a BrowserStack Paid plan. You can check paid plans here.

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
Download Copy