Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 565654d

Browse files
authoredOct 23, 2024
Revising network capture docs to remove outdated info (#2987)
* Revising network capture docs to remove outdated info * Simplified wording in cross browser docs
1 parent 694587b commit 565654d

File tree

1 file changed

+24
-53
lines changed

1 file changed

+24
-53
lines changed
 

Diff for: ‎docs/mobile-apps/features/network-capture.md

+24-53
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Otherwise your app will accidentally mark Sauce's capture as untrustworthy and i
6767

6868
:::note Android Only
6969

70-
For Android applications, a minor modification in the manifest is necessary to make your app trust our proxy certificate. We'll do this for you automatically when you upload the app to the platform.
70+
For Android applications, a minor modification in the manifest is necessary to make your app trust our proxy certificate. We'll do this for you automatically on the fly, right before we install the app to the target device.
7171

7272
:::
7373

@@ -77,13 +77,25 @@ For Android applications, a minor modification in the manifest is necessary to m
7777
The [App Settings](/mobile-apps/live-testing/live-mobile-app-testing/#app-settings) act as default configurations, but can be overridden by the capabilities specified in your test script.
7878
To control whether network capture is enabled or disabled, add the **networkCapture** capability to your test script.
7979

80-
- [Sauce-specific Appium capability networkCapture](/dev/test-configuration-options/#networkcapture)
80+
#### Appium
8181

82-
:::note Coming soon
82+
Enable the following capability when you execute your tests.
8383

84-
System-wide network capture for Espresso and XCUITest will be available soon.
84+
- [Sauce-specific Appium capability networkCapture](/dev/test-configuration-options/#networkcapture)
8585

86-
:::
86+
#### Native Tests (Espresso/XCUITest)
87+
88+
Upload your mobile app to Sauce Labs [through our UI](/mobile-apps/app-storage/#uploading-apps-via-ui) or [our REST API](/mobile-apps/app-storage/#uploading-apps-via-rest-api).
89+
90+
Navigate to **App Management** and locate your app's settings to enable the feature by default for all tests.
91+
92+
<br/><img src={useBaseUrl('img/mobile-apps/networkcapturescr.png')} alt="Mobile app settings navigation" width="600" />
93+
<br/><img src={useBaseUrl('img/mobile-apps/networkcapturescr2.png')} alt="Mobile app settings navigation" width="800" />
94+
95+
Alternatively, define it in your **saucectl** configuration the following way:
96+
97+
- [Espresso via saucectl](/mobile-apps/automated-testing/espresso-xcuitest/espresso/#networkcapture)
98+
- [XCUITest via saucectl](/mobile-apps/automated-testing/espresso-xcuitest/xcuitest/#networkcapture)
8799

88100
### Accessing Network Traffic in real-time (Live Testing)
89101

@@ -103,6 +115,13 @@ To be able to observe network traffic in real-time:
103115

104116
<img src={useBaseUrl('img/mobile-apps/network-capture-3.png')} alt="Inspect network logs" width="700"/>
105117

118+
#### Cross Browser
119+
120+
To enable System-wide network capture for cross-browser tests, click on **Developer Options** during a Live Testing session on the sidebar.
121+
122+
If you need to localize the capture context with just the browser and omit all network calls from the system entirely, then prefer
123+
using our [DevTools](/web-apps/live-testing/dev-tools/) solution. It will allow you to isolate network calls from individual browser tabs and provide a richer debugging experience.
124+
106125
### Limitations
107126
:::note Limitations
108127

@@ -214,64 +233,16 @@ The Stats row in the footer provides details on the number of requests, transfer
214233
Page Load, DOMContentLoaded, and Finished time.
215234
<img src={useBaseUrl('img/mobile-apps/network-capture-stats-row.png')} alt="Inspect network logs" width="700"/>
216235

217-
## Instrumented Network Traffic Capture
218-
<p><small><span className="sauceGreen">Espresso and XCUITest Only</span></small></p>
219-
220-
To use network capture for automated Espresso and XCUITest tests, instrumentation must be enabled.
221-
222-
To enable network traffic capturing in your tests:
223-
224-
1. On Sauce Labs, click **Live** > **Mobile App**.
225-
2. Upload your mobile app to Sauce Labs [through our UI](/mobile-apps/app-storage/#uploading-apps-via-ui) or [our REST API](/mobile-apps/app-storage/#uploading-apps-via-rest-api).
226-
3. After you’ve uploaded your app, return to the **Live** > **Mobile App** page, hover your mouse over your app, then select **Settings**.<br/><img src={useBaseUrl('img/mobile-apps/networkcapturescr.png')} alt="Mobile app settings navigation" width="600"/>
227-
4. Under **Default Settings**, toggle Instrumentation and Network Capture to enable the feature.<br/><img src={useBaseUrl('img/mobile-apps/networkcapturescr2.png')} alt="Mobile app settings navigation" width="800"/>
228-
5. Alternatively, the **networkCapture** capability can be added to your test script:
229-
- [Espresso via saucectl](/mobile-apps/automated-testing/espresso-xcuitest/espresso/#networkcapture)
230-
- [XCUITest via saucectl](/mobile-apps/automated-testing/espresso-xcuitest/xcuitest/#networkcapture)
231-
232-
:::note Coming soon
233-
234-
System-wide network capture for Espresso and XCUITest will be available soon.
235-
236-
:::
237-
238236
### Limitations
239237

240238
<!-- prettier-ignore -->
241239
:::note Not Supported
242240

243241
- Android Emulators
244242
- iOS Simulators
245-
- Android Chrome Browser in automated tests
246-
- iOS Safari Browser in automated tests
247243

248244
:::
249245

250-
#### Android
251-
252-
Our network capture feature depends on the fact that these classes are not obfuscated:
253-
254-
[OkHTTP](https://square.github.io/okhttp/)
255-
256-
- okhttp3.Interceptor
257-
- okhttp3.OkHttpClient
258-
- okhttp3.Request
259-
- okhttp3.Response
260-
- okhttp3.ResponseBody
261-
- okio.Buffer
262-
263-
[Volley](https://github.com/google/volley)
264-
265-
- com.android.volley.AuthFailureError
266-
- com.android.volley.NetworkResponse
267-
- com.android.volley.Request
268-
- com.android.volley.RequestQueue
269-
- com.android.volley.Response
270-
271-
#### iOS
272-
273-
- Network capture works if the app uses [NSURLSession](https://developer.apple.com/documentation/foundation/nsurlsession) or a library (like [Alamofire](https://github.com/Alamofire/Alamofire) or [AFNetworking](https://github.com/AFNetworking/AFNetworking)) that uses NSURLSession internally.
274-
275246
## More Information
276247

277248
- [Network Throttling](/mobile-apps/features/network-throttling)

0 commit comments

Comments
 (0)
Please sign in to comment.