Dear All,
Let me do my best to help you all....
Use driver.swipe functionality to bring the settings from bottom.
{ now if you wonder on how to find the co- ordinates , then
A. Connect iPad to your device with Appium inspector opened.
B. Swipe up the settings manually .
C. Click on 'Refresh' button in Appium Inspector.
4. You may notice "Quick Settings" preview on Appium inspector screen itself.
5. Now choose "Precise Tap" from Appium Inspector and tap over 'Wifi Icon' (Green dot will be get marked) , this will also display the "StartX" and "StartY" value.
6. Pass these value as an argument to the drive.tap (method).
}
Now mode got switched to Offline.
To close the "Settings", you don't need to swipe. Instead you may follow the same steps and tap anywhere on page.
// hiding keyboard
int tap_startX= (int) 341.2;
int tap_startY = (int)451.3;
int tap_finger= 1;
int tap_duration=2;
driver.tap(tap_finger, tap_startX , tap_startY , tap_duration );
//swipe up the settings to disable wifi
int swipe_startX= (int) 347.8;
int swipe_startY = (int)1021.4;
int swipe_endx= (int)363.6;
int swipe_endy= (int)800.6;
int swipe_duration =(int) 0.5;
driver.swipe(swipe_startX, swipe_startY, swipe_endx, swipe_endy, swipe_duration);
// disable wifi
int mode_startX= (int) 331.3;
int mode_startY = (int)907.3;
int mode_finger= 1;
int mode_duration=2;
driver.tap(mode_finger, mode_startX , mode_startY , mode_duration );