Reputation: 2460
I want to test the connectivity icon in 3 cases :
When the connection status is fine
When few heartbeats were missed and/or if the web socket is closed.
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 ?
Upvotes: 0
Views: 1331
Reputation: 26
driver.ConnectionType = ConnectionType.None;
Or something like this. In this case driver
is AndroidDriver instance for appium tests
Upvotes: 1
Reputation: 3004
i use the below code to stop wifi connection in ios :
Runtime rt = Runtime.getRuntime();
try {
rt.exec("networksetup -setairportpower en0 off");
System.out.println("Wifi OFF Successfully");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
use below to on wifi:
rt.exec("networksetup -setairportpower en0 on");
Upvotes: 1