一、安装Android Studio环境
请参考其他文章安装
二、安装手机模拟器
请参考其他文章安装
三、安装appium desktop版本
appium desktop版本下载地址:https://github.com/appium/appium-desktop/releases/
四、Android Studio中创建工程
通过“new project”先创建一个工程,然后在project中通过"new module"创建一个模块用例实现测试用例。具体请参考其他文章。
五、selenium 库和appium 库导入AS
有两种导入方式,一种是下载jar包后手动导入,还有一种是在线导入;
第一种,手动下载导入:
selenium 下载地址:http://selenium-release.storage.googleapis.com/index.html
appium 下载地址:https://search.maven.org/search?q=g:io.appium%20AND%20a:java-client
也可以从appium网站进入下载链接: http://appium.io/downloads.html
还有个工具jar包 commons-lang3-3.1.jar 也会用到。
将下载的jar包直接拷入前面创建的new module的libs目录下就可以了:
确保module的build.gradle中有如下声明,就会自动找到这两个jar包:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
}
第二种在线下载导入:
通过如下菜单选中demoTest模块,点击加号中的“Library Dependency”:
然后如下菜单中搜索需要的库,可以通过通配符匹配,注意查询的格式如下标红处,比如查询selenium库(org.