下面是我的代码
//开关网络连接操作
public static void networkConnectionTest(boolean airplaneMode, boolean wifi, boolean data,AppiumDriver driver){
log.info("开关网络连接操作");
try{
NetworkConnectionSetting networkConnection = new NetworkConnectionSetting(false, true, true);
networkConnection.setData(data);
networkConnection.setWifi(wifi);
driver.setNetworkConnection(networkConnection);
networkConnection = driver.getNetworkConnection();
assertEquals(new NetworkConnectionSetting(false, wifi, data), networkConnection);
}catch(Exception e){
log.info("开关网络连接操作失败"+ e.getMessage());
}
}
下面是报错信息,无法断开网络连接
ERROR running Appium command: Object [object Object] has no method 'setNetworkConnection'
Command duration or timeout: 20 milliseconds
Build info: version: '2.42.2', revision: '6a6995d31c7c56c340d6f45a76976d43506cd6cc', time: '2014-06-03 10:52:47'
System info: host: 'ifufeiyangtekiMac.local', ip: '192.168.235.131', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.4', java.version: '1.8.0'
Driver info: io.appium.java_client.AppiumDriver
请问,有没有其它的方法?