Test with sample data

Its easy to test scenarios that require device to be setup with sample test data (e.g. photos, videos, contacts), so that it’s made available to your application during test execution.

Pre-loaded images

We have uploaded some pre-set images in the devices gallery for you to be able to easily test your flows involving images.

Upload your own media files

You can also provide your own media files for testing. Before starting test execution, you first need to upload these test files using REST API. The REST API response will return a media_url for each successful file upload. Use this value to set browserstack.uploadMedia capability in your Appium test scripts. In the beginning of the test execution, BrowserStack will fetch and download these media files to the device.

Capability Description Values
browserstack.uploadMedia Set this capability if you want to use your uploaded images or videos in the test. Upload your custom media on BrowserStack servers using REST API. Use the media_url value returned as a result of the upload to set this capability. The media_url returned on the upload response.
Example: [“media://hashedid”, “media://hashedid”]

Example :

DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("browserstack.uploadMedia", new String[]{"media://21d66a8a0471097bbf5789330129e9ab97e467e3","media://4d5f6w4h6dq19fg4nl9o5e9ab97d1s1y0i9kl2d3d"});
var capabilities = {
	'browserstack.uploadMedia': ['media://21d66a8a0471097bbf5789330129e9ab97e467e3','media://4d5f6w4h6dq19fg4nl9o5e9ab97d1s1y0i9kl2d3d']
}
DesiredCapabilities capability = new DesiredCapabilities();
capability.SetCapability("browserstack.uploadMedia", new[] {"media://21d66a8a0471097bbf5789330129e9ab97e467e3","media://4d5f6w4h6dq19fg4nl9o5e9ab97d1s1y0i9kl2d3d"});
$capabilities = new DesiredCapabilities();
$capabilities->setCapability("browserstack.uploadMedia", ["media://21d66a8a0471097bbf5789330129e9ab97e467e3","media://4d5f6w4h6dq19fg4nl9o5e9ab97d1s1y0i9kl2d3d"]);
desired_cap = {
	'browserstack.uploadMedia': ['media://21d66a8a0471097bbf5789330129e9ab97e467e3','media://4d5f6w4h6dq19fg4nl9o5e9ab97d1s1y0i9kl2d3d']
}
desired_caps = {
    'browserstack.uploadMedia': ['media://21d66a8a0471097bbf5789330129e9ab97e467e3','media://4d5f6w4h6dq19fg4nl9o5e9ab97d1s1y0i9kl2d3d']
}
Note:
  1. Only 5 media files per test are allowed
  2. Supported format for images are JPG, JPEG, PNG, GIF, BMP and max file size allowed for images is 10MB
  3. Supported format for videos are .mp4, .mov and .3gp and max file size allowed for videos is 50MB

Pre-loaded contacts

We have pre-loaded our devices with sample contacts for you to be able to easily test scenarios that need access to contacts from the device. These sample contacts are dummy data and intended to be used exclusively for the purpose of testing. You can download these sample contacts for your reference.