Troubleshoot network logs for Appium tests
Find possible causes and workarounds for common network log issues in Appium tests on App Automate, such as session failures and missing logs.
When you enable network logs, BrowserStack routes your app’s traffic through a MITM proxy to capture it. Most network log issues come from this proxy or from how the capabilities are set. Find your issue in the following sections.
Tests fail when network logs are enabled
Use the following table if your tests pass with network logs disabled and fail with them enabled:
| Issue | Possible cause | Workaround |
|---|---|---|
| Login, webviews, maps, ads, deep links, or payment redirects fail only when network logs are enabled. | Your app or a third-party SDK in it uses certificate pinning. The BrowserStack MITM proxy that captures network logs causes requests to pinned hosts to fail. | Confirm that network logs cause the failure and exclude the pinned hosts. |
Requests to pinned hosts fail even though network logs are disabled, and you set acceptInsecureCerts. |
The acceptInsecureCerts capability also routes traffic through a proxy. |
Remove acceptInsecureCerts from your configuration if your app pins certificates. |
| Firebase and FCM push notifications, OAuth and SSO flows, or network interface name checks fail when network logs are enabled. | The proxy that captures network logs can interfere with these flows. | Exclude the affected hosts, such as fcm.googleapis.com, using networkLogsExcludeHosts. If that doesn’t help, disable network logs. |
| Network-heavy flows, such as an initial data sync, run much slower with network logs enabled. | The proxy that captures network logs adds overhead to every request. | Disable network logs for these tests, or exclude the hosts involved in the flow. |
Session fails or settings don’t take effect
Use the following table if the session fails at start or your network log settings are ignored:
| Issue | Possible cause | Workaround |
|---|---|---|
The session fails with tls_passthrough_networklogs_cap_not_set. |
You passed networkLogsExcludeHosts without setting networkLogs to true. |
Set networkLogs to true along with networkLogsExcludeHosts. |
| The session fails at start when you filter hosts. | You passed both networkLogsIncludeHosts and networkLogsExcludeHosts, or a list exceeds 10 hosts or a host entry exceeds 200 characters. |
Pass only one of the two capabilities, with at most 10 hosts of up to 200 characters each. |
| Tests still fail after you exclude the pinned hosts. | Host values use wildcards, such as *.example.com, which aren’t supported. |
Use exact hostnames or a regex value. |
Network log settings, such as host filters or captureContent, don’t take effect. |
The capabilities are nested or indented incorrectly, or aren’t passed in the format your language binding expects. | In browserstack.yml, set networkLogsIncludeHosts and networkLogsExcludeHosts at the top level and captureContent inside networkLogsOptions. For non-SDK setups, copy the code snippet for your language and protocol from Enable and configure network logs. |
Network logs are missing or incomplete
Use the following table if network logs aren’t captured or don’t show what you expect:
| Issue | Possible cause | Workaround |
|---|---|---|
The dashboard or REST API response shows BROWSERSTACK_NETWORK_LOGS_NOT_CAPTURED on an Android device. |
Network logs are disabled, or your app doesn’t trust user-added CAs, so the proxy can’t capture its traffic. | Set networkLogs to true. Then configure your app to trust user-added CAs, rebuild the app, and upload it again. |
| The Network Logs tab shows that network logs are disabled. | Network logs are disabled by default. | Enable network logs for the session. |
| Request headers and payloads appear, but the Response tab is empty. | Network logs don’t capture response bodies by default. | Set captureContent to true within networkLogsOptions. See Enable and configure network logs. |
| Requests to some hosts are missing from network logs. | Requests to hosts excluded with networkLogsExcludeHosts, or not listed in networkLogsIncludeHosts, bypass the proxy and aren’t captured. |
Review your host filters. Requests to hosts you exclude for certificate pinning can’t appear in network logs. |
| No network traffic is captured for your app. | Your app is proxy-unaware, or the device doesn’t support network logs. | Network logs aren’t supported for proxy-unaware apps. Check the device exclusions in the App Automate capabilities reference. |
| You can’t view network logs while the session is running. | App Automate makes network logs available only after the session completes. | Download the logs after the session ends, or view network logs in real time using a local proxy. |
| Network logs aren’t available after the session ends. | You routed traffic through a local proxy, such as Charles Proxy, which shows network logs only in real time. Or the logs are older than 30 days. | Use the BrowserStack network logs capability to download logs after the session. Network logs are deleted 30 days after they’re generated. |
| You want to mock, modify, or block requests during a test. | Network logs record traffic but can’t modify it. | N/A. Network logs don’t support request mocking or modification. |
If the issue persists, contact our Support team.
Related topics
- Fix certificate pinning failures
- Debug network logs generation issues or insecure certificate error issues
- Network and connection issues
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!