Programmatically turn on/off wifi on real iOS device with UI Automation
Asked Answered
A

2

6

I have already read once or twice that turn on/off wifi on a real iOS device (iPad in my case) with a UI Automation script seems not possible.

I've also read that you can create a script with the target "Settings" but it seems that it's only for simulators, am I right ?

Do you have any ideas or solutions for me ?

Regards,

Allies answered 17/2, 2014 at 12:1 Comment(3)
You can't unless jailbreak.Gargan
Are you going to create automation test-cases with wifi ON and OFF?Sublett
@Sublett : Yes I could create tests with wifi on and off but there is some contains to download within the app and wifi will be required.Allies
O
4

i was able to do so (just make sure you target application is on foremost state when doing so):

var target = UIATarget.localTarget();

target.dragFromToForDuration({x:0.1, y:557.00}, {x:211.00, y:206.00},
0.5); //to expose the actions panel on iOS

target.frontMostApp().mainWindow().elements()["Wifi"].tapWithOptions({tapOffset:{x:0.44, y:0.47}});
Olivenite answered 27/3, 2014 at 7:51 Comment(2)
it works! for my iPhone 4s starting point should be {x:0.1, y:477.00}Brassard
the only constraint would be it only works on iOS with action panel.Brassard
M
1

To do this, like @Larme states, the user's iOS device must be jailbroken due to the locked-down nature of iOS.

Momentous answered 17/2, 2014 at 16:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.