Test with sample data
Its easy to test scenarios that require device to be setup with sample test data (e.g. photos, videos), so that its made available to your application during test execution.
Pre-loaded media
We have uploaded some pre-set images and video files in the devices gallery for you to be able to easily test your flows involving images or videos.The details for these files:
File Type | Path | File names |
---|---|---|
Images | /private/var/mobile/Media/DCIM/ |
IMG_0001.PNG , IMG_0002.JPG , IMG_0003.PNG , IMG_0004.JPG , IMG_0005.JPG
|
Video | /private/var/mobile/Media/DCIM/ |
IMG_0007.MOV , IMG_0008.MOV , IMG_0009.MOV
|
Upload your own media files
You can also supply 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 uploadMedia
parameter in the REST API request to start test execution.
REST API endpoint :
POST /app-automate/xcuitest/v2/build
Parameter | Required/Optional | Description |
---|---|---|
uploadMedia |
Optional | Set this parameter 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 returned as a result of the upload in this parameter. Format: ["media://hashedid", "media://hashedid"]
|
Example cURL
request :
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/xcuitest/v2/build" \
-d '{"uploadMedia": ["media://a376df49gh31dh83geb1fa3c28f83v8a23s", "media://t5d6w1de9971b2d1ae49gh31dh83gf83v8a23s"], "devices": ["iPhone 8 Plus-11.0"], "app": "bs://f5L3azt9pLzE995f49376eb1fa3c284dc321f8d", "testSuite": "bs://6eb1fa3c284ddbe9971b2d1aee0d52943b9c081"}' \
-H "Content-Type: application/json"
You can access these uploaded media files in your test from the Camera Roll
directory. The full path to the directory is /private/var/mobile/Media/DCIM/
.
- Only 5 files are allowed per test
- Supported format for images are JPG, JPEG, PNG, GIF, BMP and maximum file size allowed for images is 10MB
- Supported format for videos are .mp4, .mov and .3gp and maximum 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.
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!