ios 9.3.3
XCUITest
desired_caps = {}
desired_caps['automationName'] = 'XCUITest'
desired_caps['platformName'] = 'iOS'
desired_caps['platformVersion'] = '9.3.3'
desired_caps['deviceName'] = 'iPhone 6'
desired_caps['bundleId'] = 'XXX'
desired_caps['udid'] = 'fb5991a499fb96bde151111111'
desired_caps['newCommandTimeout'] = 3600
desired_caps['noSign'] = "True"
desired_caps["noReset"] = "True"
remote = "http://127.0.0.1:" + "4723" + "/wd/hub"
driver = webdriver.Remote(remote, desired_caps)
time.sleep(4)
print(driver.find_element_by_xpath("//XCUIElementTypeTextField[1]")) # 可以打印
print(driver.find_element_by_xpath("//XCUIElementTypeTextField[1]/XCUIElementTypeTextField[1]")) # 找不到元素
driver.find_element_by_xpath("//XCUIElementTypeTextField[1]/XCUIElementTypeTextField[1]").send_keys("11111")
XCUIElementType
,我看论坛里有人用的阿里的app-inspector
有前缀