How can i disable internet connectivity in Android Emulator with Appium?

Tags: , , , ,



I want to test the connectivity icon in 3 cases :

  1. When the connection status is fine

  2. When few heartbeats were missed and/or if the web socket is closed.

  3. When no internet

In Case one i can test it because i’m always connected to the internet but others i can’t.

PS: I’m using TestNG with Appium and Java

What do you suggest ?

Answer

driver.ConnectionType = ConnectionType.None;

Or something like this. In this case driver is AndroidDriver instance for appium tests



Source: stackoverflow