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 ...
随机推荐
- linux c 操作utmp 和 wtmp 文件接口
/var/run/utmp 保存当前在本系统中的用户信息 /var/log/wtmp 保存登陆过本系统的用户信息 他们保存的信息是基于结构体 struct utmp 的(/usr/include/bi ...
- 怎样 获取 ios的系统版本
获得Ios系统版本的函数,比方 函数定义: [cpp] view plaincopy + (float)getIOSVersion; 函数实现: [cpp] view plaincopy + (flo ...
- POJ3463 Sightseeing
题目大意:求两点间最短路与长度为最短路长度+1的路径的条数之和. 方法1:最短路径+DP 首先求出ST间最短路径,然后根据递归式记忆化搜索(因此还要构造反向图). 我们知道到达终点的路径长度最长为ma ...
- 获取android的SDK或者手机目录路径
获取android的SDK或者手机目录路径 Google为我们提供了API来获取SDK或者手机目录路径: 1.获取SD卡目录 File file1 = Environment.getExternalS ...
- Amazon宣布将MXNet作为AWS的深度学习框架——貌似性能比tf高啊
Amazon公司的Werner Vogels于上周宣布Amazon深度学习框架将会正式选用MXNet,并且AWS将会通过增加源代码贡献.改进文档以及支持来自其它框架的可视化.开发以及迁移工具,为实现M ...
- 框架-Java:Spring MVC
ylbtech-框架-Java:Spring MVC Spring MVC属于SpringFrameWork的后续产品,已经融合在Spring Web Flow里面.Spring 框架提供了构建 We ...
- UVA-12578 10:6:2 计算几何 模拟
题面 题意:给你一块长方形,告诉你长:宽=10:6 里面有一个圆,长:半径=5:1,给你长方形的长,求圆的面积和剩余部分的面积 题解:直接模拟输出就好 #include<bits/stdc++. ...
- resgen.exe 已退出 代码为 1073741701的错误的解决办法
以管理员的身份打开命令提示窗口:(开始-运行-cmd),更改目录至"CD C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\”下 ...
- YARN环境搭建 之 二:CentOS7.0 JDK配置
Hadoop是Java写的,他无法使用Linux预安装的OpenJDK,因此安装hadoop前需要先安装JDK(1.6以上) 原材料:在Oracle官网下载的32位JDK: 说明: 1.C ...
- 深入理解 Swift 派发机制
原文: Method Dispatch in Swift作者: Brain King译者: kemchenj 译者注: 之前看了很多关于 Swift 派发机制的内容, 但感觉没有一篇能够彻底讲清楚这件 ...