How do I change the network settings during an app automation test?

How can I change the network settings during an app automation test?

Hi Helen,

LambdaTest provides an API to modify the network conditions. You can use the following example curl command to make the network offline:

curl --location --request POST 'https://mobile-api.lambdatest.com/mobile-automation/api/v1/sessions/SessionID/update_network' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Auth=' \
--data-raw '{"mode": "offline"}'

Make sure to replace ‘SessionID’ with the actual session ID of your test. This API call allows you to set the network mode to “offline” using the provided endpoint, headers, and payload.