Appium获取toast消息

时间:2021-04-21 18:01:26

Android获取toast,需要在参数里设置automationName:Uiautomator2

设置设备的信息

desired_caps = {
'platformName': 'Android',  # 平台
'platformVersion': '5.1',  # 版本号
'deviceName': 
'appPackage': 
'appActivity': 
'unicodeKeyboard': 'True',  # 防止键盘中文不能输入
'resetKeyboard': 'True',  # 重置设置生效
'automationName': 'Uiautomator2', #识别toast
'noSign':'True'
}

运行脚本,如果提示Uiautomator2错误, 需要更新appium1.6.3以上才能识别toast.
https://github.com/appium/appium-desktop/releases