Androidappium 1 Android 2 Android 3 Android spart






























- Slides: 30

Android—appium自动化测试

1. Android 自动化测试技术介绍 2. Android 自动化测试环境配置 3. Android 自动化测试spart. android 4. Android 自动化测试Ui. Automator 5. Android 自动化测试控件操作 6. Android 自动化测试client端脚本编写


Android自动化测试技术介绍 • • • Robotium Appium Uiautomator Nativedriver Monkeyrunner


Android自动化测试技术介绍 • Appium: http: //appium. io/ • • • 跨架构,原生、混合以及Web移动应用。 跨平台,Android、ios和firefoxos。 跨语言,java、python、ruby、nodejs、php、Objective-C、Java. Script、C#等。 跨app,可以在多个APP之间交互。 支持多种测试框架,Junit、Rspec、PHPUnit、Nose、Mocha、Cucumber、Capybara和 Vows等。 不依赖源代码。


Android自动化测试appium环境配置 • • 下载appium : http: //appium. io/ Appium. For. Windows-1. 2. 0. 0. zip 解压缩到本地,执行Appium. exe 下载安装Android-SDK :http: //rj. baidu. com/soft/detail/23485. html? ald

Android自动化测试appium环境配置 • 打开Eclipse提示导入Android-SDK

Android自动化测试appium环境配置 • 打开Eclipse 新建mven project


Android自动化测试appium环境配置 • • • 配置config. properties文件 在src/main/resources下新建一个config. properties文件。 加入以下配置项: version=4. 2. 2 classpath. Root=apps/person. Doctor ----指定被测试apk路径 app. Dir=person. Doctor. apk platform. Name=Android device. Name=ce 6 be 444 device=appium app-package=com. pingan. papd app-activity=com. pingan. papd. ui. activities. Logo. Activity 在mvn project 程下创建apps文件夹,在apps文件夹下以被测试apk名字创建子文件 夹,把被测试apk放入文件夹内。

Android 自动化测试spart. android


Android 自动化测试spart. android使用 Ø • • • 在上面环境配置中介绍到pom. xml配置中加入 <dependency> <group. Id>com. pajk. test</group. Id> <artifact. Id>spart. android</artifact. Id> <version>1. 0. 0 -SNAPSHOT</version> </dependency> • • • <dependency> <group. Id>com. google. inject</group. Id> <artifact. Id>guice</artifact. Id> <version>3. 0</version> <scope>test</scope> </dependency>

Android 自动化测试Ui. Automator






Android自动化测试实际应用 • 1、在appium中使用UIAutomator String class. Name = "android. widget. Edit. Text"; List<Web. Element> edit. List = driver. find. Elements. By. Android. UIAutomator("new Ui. Selector(). class. Name("+class. Name+")"); edit. List. get(0). send. Keys("15921955095"); edit. List. get(1). send. Keys("666666"); Web. Element button = driver. find. Element. By. Android. UIAutomator("new Ui. Selector(). class. Name("+button. Name+"). index(2)"); button. click(); • • • 2、使用appium提供的方法 List<Web. Element> text. List = driver. find. Elements. By. Edit. Text(); driver. generate. Page. Elements(); text. List. get(0). send. Keys("15921955095"); text. List. get(1). send. Keys("666666"); driver. find. Element. By. Name("登录"). click(); • • •

Android自动化测试实际应用 • • 3、使用我们自动生成的代码 调用driver. generate. Page. Elements(); 方法生成以下代码: • • @Find. By(xpath = "//android. widget. Edit. Text[1]") private Web. Element user. Text; • • @Find. By(xpath = "//android. widget. Edit. Text[2]") private Web. Element pwd. Test; • • @Find. By(class. Name = "android. widget. Button") private Web. Element button 1; • • • user. Text. send. Keys("15921955095"); pwd. Test. send. Keys("666666"); button 1. click(); • • • 4、使用selenium的find. Elements. By List<Web. Element> edit. List = driver. find. Elements(By. class. Name(class. Name)); edit. List. get(0). send. Keys("15921955095"); edit. List. get(1). send. Keys("666666"); Web. Element button = driver. find. Element(By. class. Name(button. Name). name("登录")); button. click();

Android自动化测试实际应用 • • driver. scroll. To("外科"); driver. find. Element. By. Name("营养/体重管理"). click();






Q&A
Android Native Android Native Android Native Android Native
Chiara Spart 739721 Organizzazione e gestione dei dati
SPART MEMBER ORIENTATION Welcome AUTHORITY STRUCTURE RCW 38
PEC Posta Elettronica Certificata Dott Giuseppe Spart www
Unit 9 1950 s60 sPart 1 Consumerism Baby
Unit 9 1950 s60 sPart 1 Consumerism Baby
Android APIs used for Android development Android Native
Android ART Android Versions Android API Levels Java
Android Game Development Android basics About Android Linux
ANDROID PHONES Contents History Introduction of android Android
android 1 Android JDK Eclipse 3 4 Android
ANDROID APPLICATION DEVELOPMENT ANDROID DEVELOPMENT DEVELOPER ANDROID COMINDEX
Android Overview Android Overview Android Google is a
android id android layoutwidth android layoutheight fillparent matchparent
Android Sensor Android Sensor Platform Android mendukung tiga
Android Emulator Android SD card Android SD card
Android Studio Android StudioAndroid Studio https developer android
Button Button Button android ididshowbtn android layoutwidthwrapcontent android
Android Android Studio Googlehttp developer android comsdkindex html
Build your Android App with Gradle Android new
MIGRATING TO ANDROID A STEPBYSTEP GUIDE FOR ANDROID
Android Sensors on Android devices LBS Augmented Reality
Recap Android Components Application Set of Android Components
ANDROID 2 D Surface Manager SGL View android
Android Mobile Application Development Introduction to Android Lecture
Android drawing Screen support Android is the OS
Android System Services Android System Services The underlying
Android Development First Steps Vasily Yevstygnyeyev History Android
What is Android Android is a Linuxbased operating
Mobile Android Computing CS 371 M Concepts Android