import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.*; import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.net.URL;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver; import org.openqa.selenium.By;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities; public class AppiumTestCase {
AppiumDriver driver; @Before
public void setUp() throws Exception {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("platforName", "Android");
capabilities.setCapability("deviceName", "05157df53de0042b");
capabilities.setCapability("platformVersion", "6.0.1");
capabilities.setCapability("appPackage", "com.sec.android.app.popupcalculator");
capabilities.setCapability("appActivity", ".Calculator");
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
} @After
public void tearDown() throws Exception {
driver.quit();
} @SuppressWarnings("deprecation")
@Test
public void test1() {
driver.findElement(By.name("9")).click();
driver.findElement(By.name("5")).click();
driver.findElement(By.name("+")).click();
driver.findElement(By.name("6")).click();
driver.findElement(By.name("=")).click(); assertTrue("ok", driver.findElement(By.name("101")).isDisplayed()); } @SuppressWarnings("deprecation")
@Test
public void test2() {
driver.findElement(By.name("9")).click();
driver.findElement(By.name("5")).click();
driver.findElement(By.name("+")).click();
driver.findElement(By.name("7")).click();
driver.findElement(By.name("=")).click(); assertTrue("ok", driver.findElement(By.name("102")).isDisplayed()); } }

  

Appium服务关键字

参考:http://www.cnblogs.com/puresoul/p/4709189.html

Appium使用总结

参考:http://www.cnblogs.com/tobecrazy/category/699177.html

http://www.2cto.com/kf/201501/368019.html

Appium定位方法总结

参考:http://www.2cto.com/kf/201410/340345.html

http://blog.csdn.net/today520/article/details/37815087

Appium实例收集

参考:http://blog.csdn.net/wirelessqa/article/details/29188455

Appium + junit 的简单实例的更多相关文章

  1. appium+robotframework的简单实例

    在上篇文章中,我们搭建好了appium+robotframework的环境,这篇文章中主要是一个简单实例. 一.测试用例编写前提 1.模拟器(或手机)连接电脑 adb devices         ...

  2. appium跑demo简单实例讲解

    安装appium,设置 demo.pyfrom appium import webdriver #要装webdriver,方法查看http://www.cnblogs.com/sincoolvip/p ...

  3. jsoup解析HTML及简单实例

    jsoup 中文参考文献    http://www.open-open.com/jsoup/ 本文将利用jsoup,简单实现网络抓取的功能,并给出一个小实例,该实例效果为:获取作者本人在博客园写的所 ...

  4. Spring boot项目搭建及简单实例

    Spring boot项目搭建 Spring Boot 概述 Build Anything with Spring Boot:Spring Boot is the starting point for ...

  5. Hibernate(二)__简单实例入门

    首先我们进一步理解什么是对象关系映射模型? 它将对数据库中数据的处理转化为对对象的处理.如下图所示: 入门简单实例: hiberante 可以用在 j2se 项目,也可以用在 j2ee (web项目中 ...

  6. 最新 Eclipse IDE下的Spring框架配置及简单实例

    前段时间开始着手学习Spring框架,又是买书又是看视频找教程的,可是鲜有介绍如何配置Spring+Eclipse的方法,现在将我的成功经验分享给大家. 本文的一些源代码来源于码农教程:http:// ...

  7. 修改js confirm alert 提示框文字的简单实例

    修改js confirm alert 提示框文字的简单实例: <!DOCTYPE html> <html> <head lang="en"> & ...

  8. 利用navicat创建存储过程、触发器和使用游标的简单实例

    利用navicat创建存储过程.触发器和使用游标的简单实例 标签: navicat存储过程触发器mysql游标 2013-08-03 21:34 15516人阅读 评论(1) 收藏 举报  分类: 数 ...

  9. 【转】Android Https服务器端和客户端简单实例

    转载地址:http://blog.csdn.net/gf771115/article/details/7827233 AndroidHttps服务器端和客户端简单实例 工具介绍 Eclipse3.7 ...

随机推荐

  1. Ubuntu Server 12.04 乱码

    sudo vim /etc/default/locale 将 下面的内容修改 LANG="zh_CN.UTF-8" LANGUAGE="zh_CN:zh" 修改 ...

  2. C语言malloc

    在子函数里面动态申请的内存不会自动被系统收回的,因为这些空间在堆里面,而不是栈,平常所说的不能返回指向栈的指针,比如在子函数里面定义一个字符指针,指向常量"hello"因为函数调用 ...

  3. 数据库中表的复杂查询&amp;分页

    一.数据库中表的复杂查询 1)连接查询 1.0连接的基本的语法格式: from TABLE1 join_type TABLE2 [on (join_condition)][where (query_c ...

  4. 腾讯云centos,nginx安装

  5. vuex 介绍

    vuex是为vue.js开发的状态管理模式,负责vue的状态管理,状态管理是干啥的呢,举个栗子,比如一个酒店,哪间屋子入住了客人,哪间屋子客人退房了,客人退房后,房间有没有清扫过,这些都需要去记录,以 ...

  6. MySQL 导入导出命令(转载)

    导出数据: mysqldump --databases -u root -p密码 数据库名> /root/guogl/XXX.sql 从sql文件导入数据: mysql -u root -p密码 ...

  7. windows 打开文件夹

    @echo off rem 建立链接 net use \\192.168.2.3\share /user:username password rem 打开共享文件夹 explorer \\192.16 ...

  8. 在给mysql数据库备份时,报错: mysqldump: Got error: 145: Table '.\shengdaxcom\pre_forum_thread' is marked as c rashed and should be repaired when using LOCK TABLES

    在给mysql数据库备份时,报错: mysqldump: Got error: 145: Table '.\shengdaxcom\pre_forum_thread' is marked as cra ...

  9. 设置VIM查找时不区分大小写

    :set ic 永久生效 vi ~/.vimrc set ic

  10. Transaction事务注解和DynamicDataSource动态数据源切换问题解决

    问题描述: 写主库开事务的情况下会导致时不时的将更新/插入操作写入到从库上, 导致mysqlException update command denied   问题原因: jetty的工作队列会重用处 ...