Define custom ID for app
On every app upload, a new value for app_url
is generated. You need to use this value to execute your XCUI tests with the latest build of the app.
If you want to use a constant value to specify the application under test and don’t want to modify your scripts after every build upload, you can define a custom ID for your app. Use the same custom ID every time you upload a new build of the app. Here is an example cURL
request to upload an iOS app with the custom ID defined as SampleApp :
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/xcuitest/v2/app" \
-F "file=@/path/to/app/file/app-debug.ipa" \
-F "custom_id=SampleApp"
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/xcuitest/v2/app" \
-F "url=https://www.browserstack.com/app-automate/sample-apps/ios/BrowserStack-SampleApp.ipa" \
-F "custom_id=SampleApp"
A sample response to the above API request is shown below :
{
"app_url":"bs://f7c874f21852ba57957a3fdc33f47514288c4ba4",
"custom_id":"SampleApp",
"shareable_id":"exampleuser/SampleApp"
}
While executing your XCUI tests, simply use the custom_id
value (SampleApp
in the above example) to specify the application under test. The test execution will pick the last uploaded build corresponding to that custom ID.
- Other users in your team can test an app uploaded by you. They need to use the shareable_id value to specify the application under test while setting the app capability in their tests.
- The use of
custom ID
orshareable ID
is optional. - The maximum character limit in the
custom_id
parameter is 100 and the characters allowed are a-z, A-Z, 0-9, period(.), underscore(_), and hyphen(-).
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!