Appium server crash after airplane mode enable/disable operation

I observed appium server crashes if we are performing airplane mode enable/disable operation multiple times. Below are actual steps am performing, please let me know if any one have faced the same and is their any resolution on this.

Steps performed:

  1. Launched appium server and created driver for android device
  2. Now performed airplane mode enable and after disable operation using below approach

NetworkConnectionSetting connection = new NetworkConnectionSetting(true, false, false);
androidDriver.setNetworkConnection(connection);

3.Quit the server in teardown method.
4. Pefromed 1,2,3 steps multiple time

Observation: Appium server stops abruptly.

I’d recommend checking the server log. My WAG is that this is a limitation of android and it disrupted the adb connection. Is there really any use case for doing these steps multiple times while testing your app?

We are having multiple non functional (network interruption) scenarios around 15 which need to be tested in batch run. Appium server crash observation is during batch run only.

Please suggest any approach if any, to overcome this limitation.

@danandpara

  1. Which version of appium ?
  2. Please provide appium-server logs