-5

Using appium how to turn ON/OFF WIFI

2 Answers2

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.