RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第五篇【AppiumLibrary校验函数介绍】
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校验函数介绍】的更多相关文章
- RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第七篇【元素定位介绍】
http://blog.csdn.net/deadgrape/article/details/50628113 我想大家在玩自动化的时候最关心的一定是如何定位元素,因为元素定位不到后面的什么方法都实现 ...
- RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第三篇【实例】
http://blog.csdn.net/deadgrape/article/details/50579565 在这一篇里我先让大家看一下RF+APPIUM这个框架的实际运行时什么样子的,给大家一个直 ...
- RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第四篇【AppiumLibrary实用函数介绍】
http://blog.csdn.net/deadgrape/article/details/50585677 通过前几篇的讲述,我相信大家已经对RF+Appium的框架已经有所了解了. 接下来我告诉 ...
- RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第六篇【AppiumLibrary等待函数介绍】
http://blog.csdn.net/deadgrape/article/details/50622441 废话不多说,少年们请看下面. Wait Until Page Contains text ...
- [转]RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第一篇【安装】
前言:关于RobotFrameWork+APPIUM实现对安卓APK的自动化测试的文章都是取自于乐于分享知识于网络的好心人们,所以我也希望我的知识可以分享给大家. 首先我们先罗列一下我们要安装的软件 ...
- RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第一篇【安装】
文章来源http://blog.csdn.net/deadgrape/article/details/50563119 前言:关于RobotFrameWork+APPIUM实现对安卓APK的自动化测试 ...
- RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第二篇【原理】
http://blog.csdn.net/deadgrape/article/details/50574459 接着上一篇,我们开始聊聊APPIUM的框架和运行模式.废话不多说直接上图. 1.首先自动 ...
- 【转】RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第二篇【原理】
接着上一篇,我们开始聊聊APPIUM的框架和运行模式.废话不多说直接上图. 1.首先自动化脚本通过RobotFrameWork将命令传递给Appium的客户端: 2.然后[Appium的客户端]将接受 ...
- Python + Robotframework + Appium 之APP自动化测试小试牛刀(Android)
Robotframework如何好?这里先不说了~ Python更不用说了~ Appium前面的文章有介绍~ 今天直接来Python+Robotframework+Appium 三者结合起来,对And ...
随机推荐
- android中图型的阴影效果(shadow-effect-with-custom-shapes)
思路: 在自己定义shape中添加一层或多层,并错开.就可以显示阴影效果.为添加立体感,button按下的时候,仅仅设置一层.我们能够通过top, bottom, right 和 left 四个參数来 ...
- tomcat下载及启动
http://tomcat.apache.org/ 打开网页,在左边选择版本,选择后网页往下面拉 拉下来,根据windows选择32还是64位的,其中zip是windows免安装版 下载后解压,然后配 ...
- php学习随记3
<? php #正則表達式 #就是一种描写叙述字符串结构的语法规则 #是一个特定的格式化模式 #1. 行定位符 /* 1) ^行首 2)$行尾 tm eqaul Tomorrow Moon ^t ...
- dns tunnel 使用 nishang 下载TXT里的cmd(TXT里)实现CC command+ ceye实现数据外发
摘自:https://hk.saowen.com/a/a06909f1c57cb8452db969b3deede4151de42a7d69f4bb52c5bf027033fb91bd Powershe ...
- Battle City
Battle City Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7208 Accepted: 2427 Descr ...
- navicat数据库同步
10.168.95.246
- sublime的一些快捷键
Sublime Text 3非常实用,但是想要用好,一些快捷键不可或缺,所以转了这个快捷键汇总. 用惯了vim,有些快捷键也懒得用了,尤其是在win下面,还有图形界面,所以个人觉得最有用的还是搜索类, ...
- 如何用jquery+ajax写省市区的三级联动?(封装和不封装两种方式)-----2017-05-14
首先,要实现如下图效果, 1.要理清思路: 先做出三个下拉菜单----根据第一个下拉菜单的value值获取第二个下拉列表的内容,第三个同理. 2.用到的数据库表:Chinastates表 规律:根据国 ...
- Redis五种数据类型及应用场景
MySql+Memcached架构的问题 实际MySQL是适合进行海量数据存储的,通过Memcached将热点数据加载到cache,加速访问,很多公司都曾经使用过这样的架构,但随着业务数据量的不断增加 ...
- ACM-ICPC北京赛区[2017-11-19]
Domains K-Dimensional Foil Graph Chinese Checkers Cats and Fish #include<stdio.h> #include< ...