*** Settings ***
Library AppiumLibrary
Library Collections
Library String
Library Dialogs
*** Test Cases ***
打开app
Comment Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator'
... app=${CURDIR}/Tudou_Phone_tudouweb.apk
Comment Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator'
... appActivity=com.tudou.ui.activity.WelcomeActivity appPackage=com.tudou.android
Comment Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator'
... browserName=Chrome
Comment Go To Url http://www.baidu.com
后台app
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android
sleep 10s
Background App 5
关闭app
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android
sleep 10s
Close All Applications
删除app
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android
Remove Application com.tudou.android
重置app
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android
Pause Execution
Reset Application
定位
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android
Pause Execution
Comment Click Element id=com.tudou.android:id/mytudouText
Comment Click Element name=我的
Comment Click Element xpath=//android.widget.TextView[contains(@text,'我的')]
Comment Click Element class="android".widget.TextView
Click Element android=new UiSelector().text("我的")
Pause Execution
Close All Applications
输入
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
Comment Input Text id=com.tudou.android:id/login_name asdasd
Comment Input Text id=com.tudou.android:id/login_pwd 2312121
Comment Input Value id=com.tudou.android:id/login_name 34534534sdf
按键
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
Comment Press Keycode 3
Comment Press Keycode 24
清空内容
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
Clear Text id=com.tudou.android:id/login_name
点击按钮
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
Click Button 我的
Comment Click Button 确定
点击元素
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
Click Element name=我的
Click Element name=马上登录
Click Element id=com.tudou.android:id/title_right_text
点击坐标
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
Click A Point 300 200
tap
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
Tap name=我的
Tap name=马上登录
Tap id=com.tudou.android:id/title_right_text
Landscape
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' browserName=Chrome
... unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
Landscape
隐藏键盘
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
Hide Keyboard
摇一摇
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
Shake
network
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
${a} Get Network Connection Status
Set Network Connection Status 1
滑动
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
Swipe 500 500 100 500 500
sleep 2s
Swipe 500 500 100 500 500
scroll
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
Comment Scroll name=牛男网 name=畅所欲言秀
Scroll To id=com.tudou.android:id/channel_subclass
zoom
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.baidu.baidumaps.WelcomeScreen
... appPackage=com.baidu.BaiduMap unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
Pinch id=com.tudou.android:id/channel_subclass 200% 50
get
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
Comment Get Element Attribute
Comment Get Element Location
Comment Get Element Size
Comment Get Elements
Comment Get Source
Comment Log Source
shoudl
Element Attribute Should Match
Element Name Should Be
Element Should Be Disabled
Element Should Be Enabled
Element Value Should Be
Page Should Contain Element
Page Should Contain Text
Page Should Not Contain Element
Page Should Not Contain Text
webview
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android unicodeKeyboard=${True} resetKeyboard=${True}
Pause Execution
${a} Get Contexts
${b} Get Current Context
Switch To Context ${a[1]}
Log Source
Comment Click Element xpath=//a[text()='开挂!那些牛逼闪闪的牛人们']
Go To Url http://www.w3school.com.cn/tiy/t.asp?f=jsref_dialog_create
Pause Execution
Sleep 2s
Select Frame name=i
Click Element //button[text()='试一下']
Sleep 2s
Unselect Frame
Click Element //input[@value='提交代码']
${url} Get Element Attribute xpath=//*[@id="footer"]/p/a href
webview2
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android
Pause Execution
${a} Get Contexts
${b} Get Current Context
Switch To Context ${a[1]}
Go To Url http://www.w3school.com.cn/tiy/loadtext.asp?f=html_dropdownbox
Pause Execution
Wait Until Page Contains Element name=cars
Select From List name=cars Fiat
Comment Click Element name=cars
Comment Switch To Context ${a[0]}
Comment Click Element name=Audi
Comment Switch To Context ${a[1]}
Get Element Attribute 图片位置 src
webview3
Open Application http://localhost:4723/wd/hub alias=tudouapp platformName=Android platformVersion=4.4 deviceName='Android Simulator' appActivity=com.tudou.ui.activity.WelcomeActivity
... appPackage=com.tudou.android
Pause Execution
${contexts} Get Contexts
Switch To Context ${contexts[1]}
Click Element //a[text()='午夜计程车:北漂少女酒吧求生']
(转)AppiumLibrary基本操作的更多相关文章
-
Key/Value之王Memcached初探:二、Memcached在.Net中的基本操作
一.Memcached ClientLib For .Net 首先,不得不说,许多语言都实现了连接Memcached的客户端,其中以Perl.PHP为主. 仅仅memcached网站上列出的语言就有: ...
-
Android Notification 详解(一)——基本操作
Android Notification 详解(一)--基本操作 版权声明:本文为博主原创文章,未经博主允许不得转载. 微博:厉圣杰 源码:AndroidDemo/Notification 文中如有纰 ...
-
Android Notification 详解——基本操作
Android Notification 详解 版权声明:本文为博主原创文章,未经博主允许不得转载. 前几天项目中有用到 Android 通知相关的内容,索性把 Android Notificatio ...
-
三、Redis基本操作——List
小喵的唠叨话:前面我们介绍了Redis的string的数据结构的原理和操作.当时我们提到Redis的键值对不仅仅是字符串.而这次我们就要介绍Redis的第二个数据结构了,List(链表).由于List ...
-
二、Redis基本操作——String(实战篇)
小喵万万没想到,上一篇博客,居然已经被阅读600次了!!!让小喵感觉压力颇大.万一有写错的地方,岂不是会误导很多筒子们.所以,恳请大家,如果看到小喵的博客有什么不对的地方,请尽快指正!谢谢! 小喵的唠 ...
-
一、Redis基本操作——String(原理篇)
小喵的唠叨话:最近京东图书大减价,小喵手痒了就买了本<Redis设计与实现>[1]来看看.这里权当小喵看书的笔记啦.这一系列的模式,主要是先介绍Redis的实现原理(可能很大一部分会直接照 ...
-
Linq查询基本操作
摘要:本文介绍Linq查询基本操作(查询关键字) - from 子句 - where 子句 - select子句 - group 子句 - into 子句 - orderby 子句 - join 子句 ...
-
C++ map的基本操作和使用
原文地址:http://blog.sina.com.cn/s/blog_61533c9b0100fa7w.html Map是c++的一个标准容器,她提供了很好一对一的关系,在一些程序中建立一个map可 ...
-
python之最强王者(10)———文件(File)、输入输出的基本操作
1. Python 文件I/O 本章只讲述所有基本的的I/O函数,更多函数请参考Python标准文档. 2.打印到屏幕 最简单的输出方法是用print语句,你可以给它传递零个或多个用逗号隔开的表达式. ...
随机推荐
-
java中equals和";==";的区别
"=="号,它比较的是一个对象在内存中的地址值, 比如2个字符串对象String s1 = new String("str");String s2 = new ...
-
SQL键值约束、索引使用
添加約束的方式: [exec sp_helpconstraint 表名]->可用于查找到表创建的约束 CREATE TABLE stuInfo ( stuName ) NOT NULL,非空約束 ...
-
thinkphp支持大小写url地址访问,不产生下划线
from:http://www.111cn.net/phper/thinkPhp/57748.htm 一.在配置文件中开启了thinkphp的大小写识别功能,使链接大小写都可以正常访问: ‘URL_C ...
-
iOS:如何通过UIEdgeInsetsMake来制作可伸缩的Button
注:本文翻译自国外iOS开发者Natasha The Robot的一篇博文,链接在此.在iOS应用中,经常会有很多Button有相同的背景图片,却由于处在不同的位置而大小不同(尽管在iOS7中Butt ...
-
hdu 4163 Stock Prices 水
#include<bits/stdc++.h> using namespace std; #define ll long long #define pi (4*atan(1.0)) #de ...
-
js 的其它运算符和优先级
三元运算符: 语法为 exp1? exp2:exp3 判断 exp1是true 和 false 如果true,则返回exp2 ,如果false ,则返回exp3 <script> if ...
-
一个轻client,多语言支持,去中心化,自己主动负载,可扩展的实时数据写服务的实现方案讨论
背景 背景是设计一个实时数据接入的模块,负责接收client的实时数据写入(如日志流,点击流),数据支持直接下沉到HBase上(兴许提供HBase上的查询),或先持久化到Kafka里.方便兴许进行一些 ...
-
【Python3爬虫】拉勾网爬虫
一.思路分析: 在之前写拉勾网的爬虫的时候,总是得到下面这个结果(真是头疼),当你看到下面这个结果的时候,也就意味着被反爬了,因为一些网站会有相应的反爬虫措施,例如很多网站会检测某一段时间某个IP的访 ...
-
Python加密保护-对可执行的exe进行保护
Python 是一种面向对象的解释型计算机程序设计语言,Python 语言写的程序不需要编译成二进制代码,可以直接从源代码运行程序. 在计算机内部,Python解释器把源代码转换成称为字节的中间形式, ...
-
Pinyin4j导读
Pinyin4j是Java中的拼音库,作者李民. 拼音这件事其实非常简单,无非是一种映射.但是拼音中包含的学问很多,很多前贤都研究过汉语拼音,提出了多种拼音方案.随着历史变迁,拼音的形式也在不断发生变 ...