需求:第一个脚本,点击Action Sheets – 点击 OK
from time import sleep
from appium import webdriver
caps ={}
# 平台版本
caps["platformName"]="iOS"
# APP信息通过xcode
caps["app"]="Users/hanxingyuan/Library/Developer/Xcode/DerivedData/UICatalog- elvxjsgcreylppcxqfmmfzwuujpo/Build/Products/Debug-iphonesimulator/UICatalog.app"
#设备名称
caps["deviceName"]="iPhone X"
#设备版本
caps["platformVersion"]="12.1"
#uuid 通过xcode获取
caps['uuid']='4A8743D2-501D-42B6-A20D-14901A5BE61B'
#创建driver对象
driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", caps)
# 等待5s
driver.implicitly_wait(5)
#点击Action Sheets
driver.find_element_by_xpath(**'(//XCUIElementTypeButton[@name="More Info"]) [1]'**).click()
#点击ok
driver.find_element_by_xpath(*