Skip to main content

Test with sample data

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

Pre-loaded media

We have uploaded some pre-set images and videos on our devices for you to test your flows involving images or videos easily. The details for these media files are as follows:

OS Pre-loaded media file path Pre-loaded media file names  
Android Images:
/sdcard/Pictures

Videos:
/sdcard/Movies
Images:
Android_O.png , BrowserStack.jpg , Laptop_with_code.jpg , Test_on_Real_Devices.jpg , UC_Browser_on_iOS.png , s8-tweet.jpg

Videos:
android-oreo.mp4 , ipx.mp4 , note_8_on_app_live_tweet.mp4
 
iOS Images:
/private/var/mobile/Media/DCIM/

Videos:
/private/var/mobile/Media/DCIM/
Images:
IMG_0001.PNG , IMG_0002.JPG , IMG_0003.PNG , IMG_0004.JPG , IMG_0005.JPG

Videos:
IMG_0007.MOV , IMG_0008.MOV , IMG_0009.MOV
s

Pre-loaded contacts

We have pre-loaded our devices with sample contacts for you 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 testing. You can download these sample contacts for your reference.

Upload your own media files

You can also use your own media files for testing. Before starting test execution, you first need to upload these media 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. BrowserStack will fetch and download these media files to the device at the beginning of the test execution.

REST API endpoint :

POST /app-automate/espresso/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/espresso/v2/build" \
-d '{"uploadMedia": ["media://a376df49gh31dh83geb1fa3c28f83v8a23s", "media://t5d6w1de9971b2d1ae49gh31dh83gf83v8a23s"], "devices": ["Samsung Galaxy S8-7.0"], "app": "bs://f5L3azt9pLzE995f49376eb1fa3c284dc321f8d", "testSuite": "bs://6eb1fa3c284ddbe9971b2d1aee0d52943b9c081"}' \
-H "Content-Type: application/json"

You can access these uploaded media files in your tests from the default Gallery app on the device. The file path for uploaded media files is /sdcard/Pictures for images and /sdcard/Movies for videos.

Note:
  1. Only 5 files are allowed per test
  2. Supported format for images are JPG, JPEG, PNG, GIF, BMP and maximum file size allowed for images is 10MB
  3. Supported format for videos are .mp4, .mov and .3gp and maximum file size allowed for videos is 50MB

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
Talk to an Expert