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
- Get spart
- Teoriile inteligentei
- Lgms powerschool
- Instrument de cercetare chestionarul
- Android development tools plugin
- Bart dashboard
- Android app
- Vhal android
- Android sensor programming
- Android studio
- Android studio
- Android advanced topics
- Android wifi driver
- Haotian tang
- Callscreeningservice example
- Java on windows phone
- Agentcraft
- Android security model
- What is force full gnss measurements
- Dsa android
- Visual studio android emulator
- Agenda en android studio
- The weighting game android
- Fldigi android
- Bhuvan rkvy app download
- Android
- Developer.android.com
- Web application deployment diagram
- Java android app
- Android telephony app
- App inventor vs android studio