当前位置:首页 > 移动开发 > 正文

Appium获取toast消息

2024-03-31 移动开发

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

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/yidong/25728.html