can wifi be switched on/off in test case through robotium
can we switch on/off the wi-fi of the device in a test cases in robotium? because i am testing an issue which needs wifi to be on in initial phase then turning off the wi-fi and continue with testing. Yes you can do it, see the example: public void testNoNetworkConnection() throws Exception { setWifiEnabled(false); // do stuff solo.something setWifiEnabled(true); } private void setWifiEnabled(boolean state) { WifiManager wifiManager = (WifiManager)solo.getCurrentActivity().getSystemService(Context.WIFI_SERVICE); wifiManager.setWifiEnabled(state); } Remember to add permission in your Manifest