http://blog.csdn.net/deadgrape/article/details/50619050

以上连作者先跪一下方便面,在上一篇中,作者遗漏了两个常用的函数:

1.长按

Long Press locator

Long press the element

这个函数的作用为:长按一个控件

2.缩小(翻译为 “捏”)

Pinch locator, percent=200%, steps=1

Pinch in on an element a certain amount.

这个函数作者老实坦白,没有试验过,个人赶脚和ZOOM是一样的(放大),缩小功能

好啦接下来开始我们的第五篇啦,校验函数的介绍。

校验主要是用来判断界面操作是否成功,主要方法有:判断URL是否正确、需要的元素是否出现、需要元素属性是否正确、等等

1.元素校验

Element Name Should Be locator, expected  
Element Should Be Disabled locator, loglevel=INFO

Verifies that element identified with locator is disabled.

Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.

Element Should Be Enabled locator, loglevel=INFO

Verifies that element identified with locator is enabled.

Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.

Element Value Should Be locator, expected

这一组为元素级别的校验,是较为细致的校验,

第一个是检查元素的NAME属性,

第二个为检查元素是否为不可用/见,

第三个为检查元素是否可用/见,

第四个为检查元素value属性;

这一组作者自己用的较少,个人认为现在做APP自动化测试,界面内容本来就不多,无需这么精细。

备注:locator为元素定位,loglevel为日志等级,expected为希望值,同学们照着填就可以了。

2.界面校验

Page Should Contain Element locator, loglevel=INFO

Verifies that current page contains locator element.

If this keyword fails, it automatically logs the page source using the log level specified with the optionalloglevel argument. Givin

Page Should Contain Text text, loglevel=INFO

Verifies that current page contains text.

If this keyword fails, it automatically logs the page source using the log level specified with the optionalloglevel argument. Giving NONE as level disables logging.

Page Should Not Contain Element locator, loglevel=INFO

Verifies that current page not contains locator element.

If this keyword fails, it automatically logs the page source using the log level specified with the optionalloglevel argument. Givin

Page Should Not Contain Text text, loglevel=INFO

Verifies that current page not contains text.

If this keyword fails, it automatically logs the page source using the log level specified with the optionalloglevel argument. Giving NONE as level disables logging.

这一组为界面级别的校验,是一个较为常用的校验,

第一个为界面必须包含什么元素,

第二个为界面必须包含什么文字信息,(最为常用)

第三个为界面必须不包含什么元素,

第四个为界面必须不包含什么文字信息,(第二个最为常用)

作者写断言的时候,大部分都用的是第二个和第四个,当然这个是作者自己的偏好,同学们还是应该更为宽广的应用函数。

第五篇的内容就这些了,希望对童鞋们的APPIUM自动化测试指路能有所帮助。如果有什么遗漏的或者说的不对的也请同

RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第五篇【AppiumLibrary校验函数介绍】的更多相关文章

  1. RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第七篇【元素定位介绍】

    http://blog.csdn.net/deadgrape/article/details/50628113 我想大家在玩自动化的时候最关心的一定是如何定位元素,因为元素定位不到后面的什么方法都实现 ...

  2. RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第三篇【实例】

    http://blog.csdn.net/deadgrape/article/details/50579565 在这一篇里我先让大家看一下RF+APPIUM这个框架的实际运行时什么样子的,给大家一个直 ...

  3. RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第四篇【AppiumLibrary实用函数介绍】

    http://blog.csdn.net/deadgrape/article/details/50585677 通过前几篇的讲述,我相信大家已经对RF+Appium的框架已经有所了解了. 接下来我告诉 ...

  4. RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第六篇【AppiumLibrary等待函数介绍】

    http://blog.csdn.net/deadgrape/article/details/50622441 废话不多说,少年们请看下面. Wait Until Page Contains text ...

  5. [转]RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第一篇【安装】

    前言:关于RobotFrameWork+APPIUM实现对安卓APK的自动化测试的文章都是取自于乐于分享知识于网络的好心人们,所以我也希望我的知识可以分享给大家. 首先我们先罗列一下我们要安装的软件 ...

  6. RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第一篇【安装】

    文章来源http://blog.csdn.net/deadgrape/article/details/50563119 前言:关于RobotFrameWork+APPIUM实现对安卓APK的自动化测试 ...

  7. RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第二篇【原理】

    http://blog.csdn.net/deadgrape/article/details/50574459 接着上一篇,我们开始聊聊APPIUM的框架和运行模式.废话不多说直接上图. 1.首先自动 ...

  8. 【转】RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第二篇【原理】

    接着上一篇,我们开始聊聊APPIUM的框架和运行模式.废话不多说直接上图. 1.首先自动化脚本通过RobotFrameWork将命令传递给Appium的客户端: 2.然后[Appium的客户端]将接受 ...

  9. Python + Robotframework + Appium 之APP自动化测试小试牛刀(Android)

    Robotframework如何好?这里先不说了~ Python更不用说了~ Appium前面的文章有介绍~ 今天直接来Python+Robotframework+Appium 三者结合起来,对And ...

随机推荐

  1. 不使用系统自带的button

    // //  LKTitleBtn.m //  01-彩票 // //  Created by Lenny  on 3/17/15. //  Copyright (c) 2015 Lenny. All ...

  2. 64位只有一种调用约定stdcall

    procedure TForm2.Button1Click(Sender: TObject); function EnumWindowsProc(Ahwnd: hwnd; AlParam: lPara ...

  3. POJ3570 Fund Management 动态规划

    题目大意 Frank从个人投资者获得了c美元的资金,可用于m天的投资.Frank可以对n(n<=8)支股票进行投资.对于每一支股票:都有一个交易上限si,表示一天最多能交易的股数:还有一个上限k ...

  4. 圆角矩形“RoundRectShape”使用详解

    圆角矩形 常用作一些组件的背景 构造函数: RoundRectShape(float[] outerRadii, RectF inset, float[] innerRadii) Specifies ...

  5. fragment.setMenuVisibility setUserVisibleHint

    [Android]Fragment真正意义上的onResume和onPause 前言 Fragment虽然有onResume和onPause的,但是这两个方法是Activity的方法,调用时机也是与A ...

  6. 0x58 数据结构优化DP

    补写一下 poj3171 设f[i]表示覆盖L~i的最小花费,把区间按左端点排序,枚举区间,f[a[i].r]=min{f[a[i].l~(a[top].r-1)]}+a[i].c (当然还要和原值比 ...

  7. The Euler function(hdoj --2824-欧拉函数)

    The Euler function Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...

  8. 【POJ 2286】 The Rotation Game

    [题目链接] http://poj.org/problem?id=2286 [算法] IDA* [代码] #include <algorithm> #include <bitset& ...

  9. Node.js:路由

    ylbtech-Node.js:路由 1.返回顶部 1. Node.js 路由 我们要为路由提供请求的 URL 和其他需要的 GET 及 POST 参数,随后路由需要根据这些数据来执行相应的代码. 因 ...

  10. HBase学习----windows10下使用eclipse搭建HBase的开发环境

    以下是我搭建HBase开发环境的一些心得(windows10) 0.安装JDK和eclipse和一个可用的HBase. 这步是最基础的,在此就不赘述了 1.创建一个java项目: 基础问题,不赘述. ...