Simulate device modes and network conditions
BrowserStack App Automate allows you to test mobile apps under different network conditions, including offline mode, airplane mode, and network profiles like 3G-UMTS-Good, 4G-LTE-Good, and more, on BrowserStack’s actual mobile device cloud.
To simulate network conditions, choose from our predefined network profiles or create a custom network profile. You need to set the networkProfile
or customNetwork
parameter in the builds REST API when you start your Flutter integration test.
Simulate device modes and network conditions using pre-defined profiles
The networkProfile
parameter enables you to simulate a device mode and specific network conditions.
To simulate the offline or airplane mode on a device, set networkProfile
to no-network
:
Profile Name | Description |
---|---|
no-network |
Disables network settings to set the device offline. |
no-network
profile is only supported on iPhones with iOS 11 & above.
Example cURL
request to simulate the device offline mode:
To simulate a specific network condition, set networkProfile to the relevant profile name from the table given here. For example, if you want to simulate a condition in which bandwidth in/out is 50/30 kbps, latency is 500 ms, and packet loss is 1%, set networkProfile
to 2g-gprs-good
.
Profile Name | Bandwidth in/out (Kbps) | Latency (ms) | Packet Loss (%) |
---|---|---|---|
2g-gprs-good | 50/30 | 500 | 1 |
2g-gprs-lossy | 30/20 | 650 | 2 |
edge-good | 250/150 | 300 | 0 |
edge-lossy | 150/100 | 500 | 1 |
3g-umts-good | 400/100 | 100 | 0 |
3g-umts-lossy | 200/50 | 200 | 1 |
3.5g-hspa-good | 1800/400 | 100 | 0 |
3.5g-hspa-lossy | 900/200 | 190 | 1 |
3.5g-hspa-plus-good | 7000/1500 | 100 | 0 |
3.5g-hspa-plus-lossy | 2000/600 | 130 | 1 |
4g-lte-good | 18000/9000 | 100 | 0 |
4g-lte-high-latency | 18000/9000 | 3000 | 0 |
4g-lte-lossy | 7000/3000 | 120 | 1 |
4g-lte-advanced-good | 25000/18000 | 80 | 0 |
4g-lte-advanced-lossy | 15000/10000 | 70 | 1 |
reset | Set network settings to BrowserStack’s default configuration |
Example cURL
request to simulate network conditions using pre-defined network profiles:
Simulate network conditions using a custom network profile
To simulate a custom network condition, specify the download speed, the upload speed, latency, and packet loss, in that order, as values for the customNetwork
parameter. For details, see the following table:
Profile | Description |
---|---|
Download speed (kbps) | Indicates the rate at which the device can retrieve data from the network, with higher values indicating faster download speeds, simulating quicker connections. |
Upload speed (kbps) | Represents the rate at which the device can send data from the device to the network, allowing for the adjustment of various upload speed scenarios. |
Latency (ms) | Measures the delay between the device sending a request and receiving a response, with higher latency values simulating delays similar to real-world conditions. |
Packet loss (%) | Allows for the simulation of data packet loss within the network, mimicking real-world scenarios. Adjusting this percentage assesses performance under adverse conditions. |
By configuring these parameters within your custom network profile, you can precisely emulate diverse network environments, facilitating effective testing and optimization of your applications and services under different conditions. This level of control ensures that your product remains robust and reliable, regardless of the network challenges it may encounter in the real world.
Example cURL request to simulate custom network condition:
Network profile and custom network features for app testing are exclusively available with a paid BrowserStack plan. You can view more details on pricing here.
Once you start the Flutter test execution, you can access the test execution results on the App Automate dashboard.
Related topics
-
Manage your uploaded test package using our REST API.
-
Use the list test package API endpoint to list your recently uploaded test package.
-
Delete your uploaded test package using the delete test package API endpoint.
-
If you have any queries, get in touch with us.
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!