Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & App Percy
No Result Found

Set debugging options

On BrowserStack App Automate, you can debug and fix your failed Espresso tests using screenshots, video recording and a variety of logs. While executing your Espresso tests, you can configure the debugging options that need to be enabled.

Instrumentation logs

Instrumentation logs are a comprehensive record of your Espresso test executions. They are used to identify all the steps executed in the test and troubleshoot errors for any failed steps. This is the output generated by the Espresso test runner (typically AndroidJUnitRunner). Instrumentation logs are accessible both from the App Automate dashboard, as well as using our REST API.

Instrumentation logs are enabled by default, and cannot be disabled.

Network logs

Network Logs capture performance data such as network traffic, latency, HTTP requests and responses in the HAR (HTTP Archive) format. You can download network logs using both the App Automate dashboard, as well as using our REST API. You can visualise HAR files using a HAR Viewer.

Network Logs are disabled by default. To enable network logs, you need to pass the networkLogs parameter in the REST API request to start Espresso test execution. An example cURL request to enable network logs is shown below :

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/espresso/v2/build" \
-d '{"networkLogs" : true, "devices": ["Samsung Galaxy S8-7.0"], "app": "bs://f7c874f21852ba57957a3fdc33f47514288c4ba4", "testSuite": "bs://e994db8333e32a5863938666c3c3491e778352ff"}' \
-H "Content-Type: application/json"

Device logs

Device logs are system logs specific to your application generated by Android logcat. They can help you access your application logs and are especially helpful if the application under test crashes during test execution.

Device logs are disabled by default. To enable device logs, you need to pass the deviceLogs parameter in the REST API request to start Espresso test execution. An example cURL request to enable device logs is shown below :

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/espresso/v2/build" \
-d '{"deviceLogs" : true, "devices": ["Samsung Galaxy S8-7.0"], "app": "bs://f7c874f21852ba57957a3fdc33f47514288c4ba4", "testSuite": "bs://e994db8333e32a5863938666c3c3491e778352ff"}' \
-H "Content-Type: application/json"

Screenshots

You can capture screenshots for your Espresso tests using the Spoon framework. Screenshots can help find the exact step and the activity where the failure occurred. They also help identify any layout or design related issues in your application.

To enable capture of screenshots using Spoon framework, you need to pass the enableSpoonFramework parameter in the REST API request to start Espresso test execution. See the espresso-app-browserstack sample app for more details on integrating Spoon framework. An example cURL request to enable screenshots is shown below :

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/espresso/v2/build" \
-d '{"enableSpoonFramework" : true, "devices": ["Samsung Galaxy S8-7.0"], "app": "bs://f7c874f21852ba57957a3fdc33f47514288c4ba4", "testSuite": "bs://e994db8333e32a5863938666c3c3491e778352ff"}' \
-H "Content-Type: application/json"

Video recording

Every test run on the BrowserStack is recorded exactly as it is executed on remote device. This feature is particularly helpful whenever a test fails - it helps you see the entire test in action. You can access these videos from the App Automate dashboard. You can also download the videos from the dashboard or retrieve a link to download the video using our REST API.

Video logs are enabled by default. Note that video recording slightly increases the text execution time. To disable video recording, you need to set the video parameter to false in the REST API request to start Espresso test execution.

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/espresso/v2/build" \
-d '{"video" : false, "devices": ["Samsung Galaxy S8-7.0"], "app": "bs://f7c874f21852ba57957a3fdc33f47514288c4ba4", "testSuite": "bs://e994db8333e32a5863938666c3c3491e778352ff"}' \
-H "Content-Type: application/json"
Note: Your video recordings are retained on BrowserStack for 30 days from the day of test execution. All other test execution data, including screenshots and logs, are retained on BrowserStack for 60 days from the day of test execution.

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 Check Circle