Skip to content
Advertisement

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

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 ?

Advertisement

Answer

driver.ConnectionType = ConnectionType.None;

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

Advertisement