经查询appium1.6.3以上才能识别toast,之前安装appium版本是1.4.X,于是重整了测试环境,这篇后半部分有记录appium环境搭建(Android)
官方文档是这么说的
Firstly you should install appium server. Appium getting started. The version 1.6.3 or greater is recommended.
Since version 5.x there many features based on Java 8. So we recommend to install JDK SE 8 and provide that source compatibility.
也就是更新appium 到1.6.3以上,java-client版本最好是5.x,jdk要用1.8、selenium要用3.x,其他版本不一定兼容,要自己亲测是否可用
根据要求重整环境如下:
appium:1.6.3
UiAutomator2 Drvier: 0.2.3
java-client :5.0.0-BETA6
selenium:3.3.1
jdk:1.8
sdk:4.4.2
想识别toast,官网是这么说
There are three automation types
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.SELENDROID);
This automation type is usually recommended for old versions (<4.2) of Android.
Default Android UIAutomator does not require any specific capability. However you can
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.APPIUM);
You have to define this automation type to be able to use Android UIAutomator2 for new Android versions
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName