Network logs

Network Logs capture performance data such as network traffic, latency, HTTP requests and responses in the HAR (HTTP Archive) format. You can leverage network logs to get a clear picture of all the network requests (e.g. REST API calls) originating from your app, and the time taken for each of these requests. It can help you identify performance bottenecks or debug failed REST API responses. You can visualize HAR files using the HAR Viewer.

Network logs are disabled by default. To enable network logs, use the browserstack.networkLogs capability.

Capability Description Value
browserstack.networkLogs Capture network logs for your test true, false
Default: false

Example :

DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("browserstack.networkLogs", "true");
var capabilities = {
	'browserstack.networkLogs': 'true',
}
DesiredCapabilities capability = new DesiredCapabilities();
capability.SetCapability("browserstack.networkLogs", "true");
$capabilities = new DesiredCapabilities();
$capabilities->setCapability("browserstack.networkLogs", "true");
desired_cap = {
	'browserstack.networkLogs': 'true'
}
desired_caps = {
    'browserstack.networkLogs': 'true'
}
Note: Network logs feature for app testing is only available with a BrowserStack paid plan. View details.

Access network logs from the dashboard:

The network logs can be viewed from the test sessions details page on the App Automate Dashboard. You can download network logs using the Raw Network Logs link.

net

Example network logs:

example

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: You may experience minor impact on test execution speed when Network Logs are enabled