1.手势方法
#手势方法######################################################################
# 在wlan元素上做一次轻敲
el = driver.find_element(MobileBy.XPATH, "//*[@text='WLAN']")
# 1 实例化touch_action对象
touch_action = TouchAction(driver)
# 2 调用手势方法后 perform执行
touch_action.press(el).wait(2000).release().perform()
time.sleep(1)
# 按下wifi元素2s后抬起
wifi_el = driver.find_element(MobileBy.XPATH, "//*[@text='wireless']")
touch_action.press(wifi_el).wait(2000).release().perform()
time.sleep(3)
# 即传入元素,也传入坐标, 点击的位置是相对于元素的坐标偏移量
# 定位开启文本坐标偏移 x=200, y=350后轻触
return_el = driver.find_element(MobileBy.XPATH, "//*[@text='开启']")
TouchAction(driver).tap(return_el, x=200, y=350).perform()
time.sleep(3)
# 找到安全元素
loc = MobileBy.XPATH, "//*[@text='安全