Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 38 additions & 17 deletions docs/app-auto-network-throttling.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,16 @@ By the end of this guide, you will learn how to:
}
```


:::note
To utilize the **networkProfile** capability, ensure that you include `network: True` in the capabilities
To utilize the **networkProfile** capability, ensure that you include `network: True` in the capabilities.
:::


### During Test Execution

- **LambdaHook:** Dynamically alter the network profile within the test session using the following LambdaHook:

```python
driver.execute_script("updateNetworkProfile=3g-umts-good")
```
- **Offline** mode can be supported during test execution by using using the following LambdaHook (only for **android**):

```python
driver.execute_script("updateNetworkProfile=offline")
```

### Supported Network Profiles

Expand All @@ -109,31 +101,60 @@ To utilize the **networkProfile** capability, ensure that you include `network:
| 3g-umts-good | 5 Mbps | 2 Mbps | 100 ms |
| 4g-lte-good | 15 Mbps | 7 Mbps | 70 ms |
| 4g-lte-advanced-good | 25 Mbps | 12 Mbps | 20 ms |
| default | NA | NA | NA |
| default | NA | NA | NA |

> Download speed is currently stable, expect additional feature updates shortly.

### Custom Profiles

- **LambdaHook:** Define and implement custom network profiles with LambdaHook by specifying the maximum download speed (kbps), maximum upload speed (kbps), and latency (ms) for the custom condition, as illustrated in the example.

```python
driver.execute_script("customNetworkProfile: { \"downloadSpeed\": 500, \"uploadSpeed\" : 250, \"latency\": 100 }" )
```

### Default/Reset network configuration
### Default/Reset Network Configuration

- **LambdaHook:** Employ this webhook to seamlessly restore the device's network profile to its default state. Invocation of this LambdaHook removes any predefined or custom network settings, ensuring the device is reset to its original configuration.

```python
driver.execute_script("updateNetworkProfile=default")
```

:::caution
### Offline Mode

#### Android

- To initialize tests in **offline mode**, set the `networkProfile` capability to `offline` during session initiation:
```python
caps = {
"network": True,
"networkProfile": "offline" # Set to offline mode
}
```

- **LambdaHook:** You can also switch to offline mode during the test execution with the following command:
```python
driver.execute_script("updateNetworkProfile=offline")
```

#### iOS

- For **iOS** devices, offline mode cannot be set using the `networkProfile` capability. Instead, use the offline mode API by sending a cURL request within the running test session:
```bash
curl --location 'https://mobile-api.lambdatest.com/mobile-automation/api/v1/sessions/<session-id>/update_network' \
--header 'Authorization: Basic <username:access_key>' \
--header 'Content-Type: application/json' \
--data '{"mode": "offline"}'
```


:::note
- **Network throttling** results may vary sometimes based on multiple factors including network conditions and device performance.

- **Wrong Capability Name or Value:** Providing an incorrect capability value results in a bad request error with a descriptive message.
- **LambdaHook Error:** If you pass any wrong value in LambdaHook,you will receive an error message.
:::

- **LambdaHook Error:** If you pass any wrong value in LambdaHook, you will receive an error message.

- In offline mode, **live video** will not be available for the duration of the test session.
:::

> In case you have any questions, feel free to share them with us.Our experts are available on <span className="doc__lt" onClick={() => window.openLTChatWidget()}>**24/7 Customer chat support**</span>. You can also drop us a mail at support@lambdatest.com. Happy testing! 🙂

Expand Down
2 changes: 2 additions & 0 deletions docs/espresso-supported-capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ This document provide details about the features and capabilities supported for
| queueTimeout | Integer | Total execution time of the build. Example: `queueTimeout: 300`. Maximum value is `10800`|
| idleTimeout | Integer | Enter the time in seconds for maximum running time of a test in a build. Example: `idleTimeout: 120`|
| deviceLog | Boolean | To generate the device logs, pass the value as `deviceLog: true` |
| network | Boolean | To generate the network logs , pass the value as `network: true` |
| network.har | Boolean | To generate the network logs in .har format, pass the value as `network.har: true` only works with `network:true` |
| build | String | To set the Espresso build name. Example: `build: My Espresso Build`. |
| geoLocation | String | Set the geolocation country code if you want to enable the same in your test. Example - `geoLocation: FR`|
| tunnel, tunnelName | Boolean | To activate the tunnel mode, pass the value as `tunnel: true` and provide the name of your tunnel as `tunnelName: NewTunnel` |
Expand Down
Loading