打开uiautomatorviewer: uiautomatorviewer
uiautomator api: https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable
app:https://m.hujiang.com/ar_ANDROID_69/?source=PC
chromedriver下载路径: https://chromedriver.storage.googleapis.com/index.html
chrome remote debug: https://www.girish.in/how-remote-debugging-works-in-chrome/
chrome版本对应:https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/chromedriver.md
adb forward tcp:4000 localabstract:webview_devtools_remote_23323
def test_scrollable(self):
# 测试如何使用uiautomator查询列表中的元素
self.driver.find_element_by_accessibility_id('Graphics').click()
ua_scroll = 'new UiScrollable(new UiSelector().className("android.widget.ListView")).scrollIntoView(new UiSelector().text("UnicodeChart"))'
self.driver.find_element_by_android_uiautomator(ua_scroll).click()
sleep(5)
微信小程序
获取小程序进程
adb shell dumpsys activity top | grep ACTIVITY
adb shell ps {端口号}
com.tencent.mm:appbrand0
'appPackage': 'com.tencent.mm'
'appActivity': 'com.tencent.mm.ui.LauncherUI'
作业1:
一个appium自动化过程中,ADB做了哪些事情,并且把相关的命令截取出来;
作业2:
利用uiscrollable编写一个脚本,并实现一个自定义手势;
作业3:
基于沪江学习编写webview自动化脚本;
附加作业:
利用python实现一个Appiumserver的启动和关闭;