Enable Local Testing for XCUI tests
Enable Local Testing for XCUI tests on BrowserStack App Automate, to test apps that retrieve data from local servers, CI/CD machines/nodes, and other private network configurations.
This guide shows you how to set up and use Local Testing with BrowserStack App Automate to test apps that retrieve data from servers on your local machine, CI/CD machines/nodes, and other private network configurations.
Enabling Local Testing with App Automate is a two-step process:
- Establish a Local Testing connection.
- Configure your execution REST API call so that the execution happens through the Local Testing connection.
Establish a Local Testing connection
You can start a Local Testing connection through your command line by following the steps below:
-
Download the appropriate binary for your system:
- Unzip the binary to a folder/directory on your machine.
- Open your command line and navigate to the folder containing the Local binary.
- Run the binary using the following command:
./BrowserStackLocal --key YOUR_ACCESS_KEY
BrowserStackLocal.exe --key YOUR_ACCESS_KEY
The download links are secure. The binaries are digitally signed, identifying the publisher as ‘BrowserStack Ltd’.
Configure tests to run with Local Testing connection
After establishing the Local Testing connection, set the local parameter to true. Use the following API request to execute the test locally:
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/xcuitest/v2/build" \
-d '{"local": "true", "devices": ["iPhone 8 Plus-11"], "app": "bs://f5L3azt9pLzE995f49376eb1fa3c284dc321f8d", "testSuite": "bs://6eb1fa3c284ddbe9971b2d1aee0d52943b9c081"}' \
-H "Content-Type: application/json"
Remember to update the app and testSuite parameters with the app_url and test_url of your uploaded app and test suite on BrowserStack.
The binary connection needs to be established before executing the test suite, and disconnected only after execution is complete.
The Local Testing setup differs slightly based on your requirements, such as proxy settings or restricting connections to certain domains.
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!