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

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.

Note:
  • Free trial users do not have access to the network logs feature for app testing. To subscribe to a paid plan, visit the pricing page.
  • Network Logs feature is supported on all devices except the devices listed here under the Capabilities Reference section.
  • Network Logs feature is not supported for proxy-unaware apps.

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 :

REST API endpoint :

POST /app-automate/espresso/v2/build
Parameter Description Values
networkLogs Capture network logs during Espresso test execution. true, false
Default: false

Example cURL request:

Enable network logs for an Espresso test execution :

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"

View network logs on the dashboard:

You can download network logs using the Network Logs tab on the test details page of App Automate dashboard. Sample network logs are shown below :

Sample network logs of a session

Network Log configurations

By default, network logs does not capture response payload. In order to capture response payload, you need to set captureContent configuration to true inside the browserstack.networkLogsOptions parameter in the REST API request.

Example cURL request:

Enable capture content for an Espresso test execution :

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

The following table provides information about the parameter:

Parameter Configuration Value
browserstack.networkLogsOptions captureContent true, false
Default: false (no content under Response tab)

Import network logs using REST API:

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" -X GET "https://api-cloud.browserstack.com/app-automate/builds/<build-id>/sessions/<session-id>/networklogs"
Note:
  1. You may experience minor impact on test execution speed when Network Logs are enabled.
  2. Certain apps such as Play Store, App Store, TestFlight etc. might not work on all OS versions when network logs are enabled.
  3. Network logs will not be available if allowDeviceMockServer is set to true.

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