Wifi Enable/Disable on iPhone using Appium

Hi All,

I have been trying to enable wifi in iPhone using swipe from bottom screen, after swiping screen up i couldn’t able to click airplane/wifi option on iOS 8.4, even i have been used x, y coordinates also.

int height = driver.manage().window().getSize().getHeight();
int width = driver.manage().window().getSize().getWidth();
//swiping the control center up
driver.swipe(width/2, height, width/2, height-200, 500);
driver.swipe(width/2, height, width/2, height-200, 500);
Thread.sleep(1000);

	int startX= 98;

	int startY = 170;

	int finger= 1;

	int duration=20;

	driver.tap(finger,startX,startY,duration);
	
	MobileElement Wifi = (MobileElement) method.getElementById("Wi-Fi");
	
	Wifi.click();

Please help me to this issue and thanks in advance

Thanks,
Senthilkumar

This old related thread may be of use to you: How to turn on off wifi using appium in iOS devices