Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & App Percy
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Simulate device modes and network conditions

Simulate different network conditions such as bandwidth, latency, and packet loss for your Flutter test executions on BrowserStack App Automate.

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 (Android or iOS) when starting your Flutter integration test.

Parameter Description Value
networkProfile Simulate different network conditions from the list of existing network profiles <profile-name>
Example: 2g-gprs-good, 2g-gprs-lossy, 3g-umts-good etc.
Parameter Description Value
customNetwork Simulate a custom network condition download speed (kbps), upload speed (kbps), latency (ms), packet loss (%)
E.g. “1000, 1000, 100, 1”

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 or airplane-mode:

Profile Name Description
no-network Disables network settings to set the device offline.
airplane-mode Turns on the Airplane mode setting on the device.

Example cURL request to simulate the device offline mode:

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/flutter-integration-tests/v2/android/build" \
-d '{"networkProfile": "no-network", "devices": ["Samsung Galaxy S8-7.0"], "app": "bs://f7c874f21852ba57957a3fdc33f47514288c4ba4", "testSuite": "bs://e994db8333e32a5863938666c3c3491e778352ff"}' \
-H "Content-Type: application/json"

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 in your custom network profile, you can test how your app behaves under network conditions close to what your users encounter in the real world.

Example cURL request to simulate custom network condition:

Terminal
Copy icon Copy

Network profile and custom network features for app testing are exclusively available with a paid BrowserStack plan. See our pricing plans for more details.

  • Manage your uploaded apps or test packages using our REST API (Android or iOS).

  • Use the list recent builds API (Android or iOS) to list your recently uploaded apps.

  • Delete your uploaded apps or test packages using the delete API endpoint (Android or iOS).

  • 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





Thank you for your valuable feedback

Is this page helping you?

Yes
No

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!

Talk to an Expert
Download Copy Check Circle