import os,time,unittest #from selenium import webdriver from appium import webdriver PATH = lambda p:os.path.abspath(os.path.join(os.path.dirname(__file__),p)) desired_caps ={} desired_caps['platformName']='Android' desired_caps['platformVersion']='5.1.1' desired_caps['deviceName'] = 'vivo X7' desired_caps['app'] = PATH(r'C:UsersAdministratorDesktopapp-debug.apk') desired_caps['appPackage'] = 'com.xx.xx' desired_caps['appActivity'] = 'com.xx.xx.activity.MainActivity' driver = webdriver.Remote("http://localhost:4723/wd/hub", desired_caps) time.sleep(10) #driver.find_element_by_name("0").click() time.sleep(3) driver.find_element_by_id("com.xx.xx:id/face_filter_btn").click() driver.quit()