import os
from selenium import webdriver
desired_caps={}
desired_caps['platformName']='Android'
desired_caps['platformVersion']='9'

Appium (default) or Selendroid or UiAutomator2 or Espresso for Android or XCUITest for iOS or YouiEngine for application built with You.i Engine

desired_caps['automationName']='UiAutomator2'

desired_caps['deviceName']='D3H7N18125005455'
desired_caps['app']='C:\Users\NXQ\Desktop\ContactManager.apk'
desired_caps['app-package']='com.example.android.contactmanager'
desired_caps['app-activity']='com.example.android.contactmanager.ContactManager'
desired_caps['waitappActivity'] = 'com.example.android.contactmanager.ContactManager'

driver=webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
el=driver.find_element_by_name('Add Contact')
el.click()

textfields=driver.find_element_by_tag_name('textfield')
textfields[0].send_keys('My Nmae')
textfields[2].send_keys('someone@some.com')

driver.find_element_by_name('Save').click()
driver.quit()

iOSNsPredicateString

UIselector

标签: none

添加新评论