Skip to main content

Specify app

Once an app is uploaded to BrowserStack using REST API, you must specify the app to run the tests on in your appium scripts. In order to do so, you need to use the app capability in your test scripts and set its value in one of the following ways :

  1. Using an app_url value: This is returned in the response to an app upload API request.

  2. Using a custom_id value: This is the custom ID you defined in an app upload API request. By default, it will pick the last build of your uploaded app under the given custom ID.

  3. Using a shareable_id value: This is returned in the response to an app upload API request. It enables other users in your organization to test an app you uploaded.

app is a required capability to execute appium tests on BrowserStack.

Capability Description Values
app Specify the app to test on For your uploaded app, use one of these values : <app_url> or <custom_id> or <shareable_id>
browserstack.app_version If custom ID is being used to set the app capability, this can be used to test previous builds of your uploaded app under the given custom ID. This is optional. ‘-1’, ‘-2’ and so on. This will pick the latest-1, latest-2 etc. builds of your uploaded app to install on the target device

Examples:

Use app_url to specify the app

desired_caps = {
    'app': 'bs://9fg0rt302be241e6524ebc67253ecdee266343'
}
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("app", "bs://9fg0rt302be241e6524ebc67253ecdee266343");
desired_cap = {
	'app': 'bs://9fg0rt302be241e6524ebc67253ecdee266343'
}
var capabilities = {
	'app': 'bs://9fg0rt302be241e6524ebc67253ecdee266343'
}
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.SetCapability("app", "bs://9fg0rt302be241e6524ebc67253ecdee266343");
$capabilities = new DesiredCapabilities();
$capabilities->setCapability("app", "bs://9fg0rt302be241e6524ebc67253ecdee266343");

Use custom_id to specify the app:

desired_caps = {
    'app': 'MyCalculatorApp'
}
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("app", "MyCalculatorApp");
desired_cap = {
	'app': 'MyCalculatorApp'
}
desired_cap = {
	'app': 'MyCalculatorApp'
}
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.SetCapability("app", "MyCalculatorApp");
$capabilities = new DesiredCapabilities();
$capabilities->setCapability("app", "MyCalculatorApp");

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