Using appium how to turn ON/OFF WIFI
Asked
Active
Viewed 2,260 times
-5
-
Add Some HTML/screenshot /code to help you better. – Kishan Patel Feb 27 '17 at 10:46
-
By accessing control center. Read this answer https://stackoverflow.com/a/35124632 – Mani Vannan Mar 09 '20 at 05:56
2 Answers
1
There is no context to the question but I'll leave my solution. It might help someone.
I'm using XCUITestDriver with python.
driver.activate_app('com.apple.Preferences') # opens settings
driver.find_element_by_xpath('//XCUIElementTypeCell[@name="Wi-Fi"]').click() # click on WiFi
driver.find_element_by_xpath('//XCUIElementTypeSwitch').click() # click on the WiFi switch
driver.activate_app(<BundleID of your app>) # back to your app
You can also access the value of switch to get the current state. Assuming you have a variable for the element
switch.get_attibute('value')

Ciszko
- 175
- 1
- 13
0
iOS read device,By appium/any automation tool, there is NO option to turn ON/OFF. iOS Device, Automation Scope is up to your app which is debug enabled. System Default apps or any apps which are downloaded from App Store are not accessible by automation.

arul christopher
- 219
- 1
- 8