有道云添加一个笔记,笔记的title为aff
使用appium 把这篇文章分享到qq,前提是android里面有登录qq
Python代码
from appium import webdriver if __name__ =="__main__":
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0.1'
desired_caps['deviceName'] = 'Q3VDU14C25003397'
desired_caps['appPackage'] = 'com.youdao.note'
desired_caps['appActivity'] = 'com.youdao.note.activity2.SplashActivity'
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
driver.find_element_by_xpath("//android.widget.TextView[@text='aff']").click()
driver.find_element_by_id("com.youdao.note:id/menu_share").click()
driver.find_element_by_id("com.youdao.note:id/share_cqq").click()
driver.find_element_by_android_uiautomator("text(\"我的电脑\")").click()
driver.find_element_by_id("com.tencent.mobileqq:id/dialogRightBtn").click()