appium
电话键
KEYCODE_CALL 拨号键 5
KEYCODE_ENDCALL 挂机键 6
KEYCODE_HOME 按键Home 3
KEYCODE_MENU 菜单键 82
KEYCODE_BACK 返回键 4
KEYCODE_SEARCH 搜索键 84
KEYCODE_CAMERA 拍照键 27
KEYCODE_FOCUS 拍照对焦键 80
KEYCODE_POWER 电源键 26
KEYCODE_NOTIFICATION 通知键 83
KEYCODE_MUTE 话筒静音键 91
KEYCODE_VOLUME_MUTE 扬声器静音键 164
KEYCODE_VOLUME_UP 音量增加键 24
KEYCODE_VOLUME_DOWN 音量减小键 25
控制键
KEYCODE_ENTER 回车键 66
KEYCODE_ESCAPE ESC键 111
KEYCODE_DPAD_CENTER 导航键 确定键 23
KEYCODE_DPAD_UP 导航键 向上 19
KEYCODE_DPAD_DOWN 导航键 向下 20
KEYCODE_DPAD_LEFT 导航键 向左 21
KEYCODE_DPAD_RIGHT 导航键 向右 22
KEYCODE_MOVE_HOME 光标移动到开始键 122
KEYCODE_MOVE_END 光标移动到末尾键 123
KEYCODE_PAGE_UP 向上翻页键 92
KEYCODE_PAGE_DOWN 向下翻页键 93
KEYCODE_DEL 退格键 67
KEYCODE_FORWARD_DEL 删除键 112
KEYCODE_INSERT 插入键 124
KEYCODE_TAB Tab键 61
KEYCODE_NUM_LOCK 小键盘锁 143
KEYCODE_CAPS_LOCK 大写锁定键 115
KEYCODE_BREAK Break/Pause键 121
KEYCODE_SCROLL_LOCK 滚动锁定键 116
KEYCODE_ZOOM_IN 放大键 168
KEYCODE_ZOOM_OUT 缩小键 169
组合键
KEYCODE_ALT_LEFT Alt+Left
KEYCODE_ALT_RIGHT Alt+Right
KEYCODE_CTRL_LEFT Control+Left
KEYCODE_CTRL_RIGHT Control+Right
KEYCODE_SHIFT_LEFT Shift+Left
KEYCODE_SHIFT_RIGHT Shift+Right
基本
KEYCODE_0 按键'0' 7
KEYCODE_1 按键'1' 8
KEYCODE_2 按键'2' 9
KEYCODE_3 按键'3' 10
KEYCODE_4 按键'4' 11
KEYCODE_5 按键'5' 12
KEYCODE_6 按键'6' 13
KEYCODE_7 按键'7' 14
KEYCODE_8 按键'8' 15
KEYCODE_9 按键'9' 16
KEYCODE_A 按键'A' 29
KEYCODE_B 按键'B' 30
KEYCODE_C 按键'C' 31
KEYCODE_D 按键'D' 32
KEYCODE_E 按键'E' 33
KEYCODE_F 按键'F' 34
KEYCODE_G 按键'G' 35
KEYCODE_H 按键'H' 36
KEYCODE_I 按键'I' 37
KEYCODE_J 按键'J' 38
KEYCODE_K 按键'K' 39
KEYCODE_L 按键'L' 40
KEYCODE_M 按键'M' 41
KEYCODE_N 按键'N' 42
KEYCODE_O 按键'O' 43
KEYCODE_P 按键'P' 44
KEYCODE_Q 按键'Q' 45
KEYCODE_R 按键'R' 46
KEYCODE_S 按键'S' 47
KEYCODE_T 按键'T' 48
KEYCODE_U 按键'U' 49
KEYCODE_V 按键'V' 50
KEYCODE_W 按键'W' 51
KEYCODE_X 按键'X' 52
KEYCODE_Y 按键'Y' 53
KEYCODE_Z 按键'Z' 54
*** 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()='测试']
appium的更多相关文章
- Appium移动自动化框架
引言:Appium 是一个移动端自动化测试开源工具,可以针对不同的平台用一套API来编写测试用例.本文对Appium自动化测试框架的功能进行了概括. 本文选自<软件自动化测试开发>. Ap ...
- appium+robotframework环境搭建
appium+robotframework环境搭建步骤(Windows系统的appium自动化测试,只适用于测试安卓机:ios机需要在mac搭建appium环境后测试) 搭建步骤,共分为3部分: 一. ...
- Appium python API 总结
Appium python api 根据testerhome的文章,再补充一些文章里面没有提及的API [TOC] [1]find element driver 的方法 注意:这几个方法只能通过sel ...
- Appium scroll 滑动查找
首先看uiautomator如何实现滑动查找 UiScrollable scrollView = new UiScrollable(new UiSelector().className("a ...
- Appium+python的一个简单完整的用例
最近一直在忙,终于有时间来整理一下,传一个简单的用例,运行之后可以看到用例的报告,希望对大家有帮助. HTMLTestRunner这个包网上有很多,大家可以自己下载. 1 import unittes ...
- Appium环境搭建+cordova
1.安装JDK 配置JAVA_HOME(变量值为jdk的安装目录)以及Path path值如下: 验证是否生效 2.安装node.js 选择适合自己的版本官网直接下载https://nodejs.or ...
- Appium简单测试用例
工程目录如下: 封装初始化androiddriver 方法 import org.openqa.selenium.remote.DesiredCapabilities; import java.io. ...
- appium常用方法整理
1.相对坐标解锁九宫格 应用场景 QQ解锁屏幕如上,可见九个按键在同一个View下面,要实现解锁,用press moveTo release perform方法 实现代码如下: WebElem ...
- appium 滑动
前些日子,配置好了appium测试环境,至于环境怎么搭建,参考:http://www.cnblogs.com/tobecrazy/p/4562199.html 知乎Android客户端登陆:htt ...
- Appium 三种wait方法(appium 学习之改造轮子)
前些日子,配置好了appium测试环境,至于环境怎么搭建,参考:http://www.cnblogs.com/tobecrazy/p/4562199.html 知乎Android客户端登陆:htt ...
随机推荐
- 检查ftp备份数据完整性及短信告警的shell脚本
发布:thebaby 来源:net [大 中 小] 检查ftp备份数据完整性及短信告警的shell,有需要的朋友可以参考下. 该脚本实现如下的功能: 对远程备份到ftp服务器的数据完整性及 ...
- DISC免费性格测试题
现在给大家推荐一款世界500强和猎头公司招聘人才时用的DISC性格测评,用在找对象方面也比较合适.大家不妨看下自己的性格,就知道该找什么样的意中人啦--- 在每一个大标题中的四个选择题中只选择一个最符 ...
- lua在MacOS系统上的安装方法
lua是一种非常小巧的脚本语言,由标准C编写而成,可以很方便的调用c/c++或者被c/c++.另外相关的还有一个luaJIT,是lua在某些平台上的编译器. 我们在这里只安装lua. 1.检测电脑上是 ...
- crontab没有正确重定向导致磁盘inode节点空间满
通常是发现磁盘没有满但是无法写入文件.提示“no space left on device” 用df -i 查看,应该会发现相应的分区是100% 一般都是crontab的job有问题,造成 ...
- microsoft office visio基本使用方法
以下是画流程图.程序内存分配等等框图用到的点滴使用方法,记录在这里以备偶尔只需. 1.画大括号“{}” 在Visio操作界面下,依次点击“文件(File)”—“形状(Shapes)”--“其他Visi ...
- Servlet和Tomcat部署
今天有空写个Servlet来玩一下.用EditPlus写一个简单的Servlet,FirstServlet.java,如下: import java.io.IOException; import ja ...
- 【BZOJ 2820】 YY的GCD (莫比乌斯+分块)
YY的GCD Description 神犇YY虐完数论后给傻×kAc出了一题 给定N, M,求1<=x<=N, 1<=y<=M且gcd(x, y)为质数的(x, y)有多少 ...
- CAS单点登录配置[4]:客户端配置
本节介绍一下客户端如何配置,客户端配置没有服务端那么复杂... 客户端Tomcat配置 1 首先确认证书文件已经拷贝到Tomcat的目录下,我们新建两个客户端的web应用,分别命名为Client1,C ...
- java WebService简单使用案例
首先,建立一个WebService: package garfield; import javax.jws.WebService; import javax.xml.ws.Endpoint; @Web ...
- Winform的多线程问题
http://blog.csdn.net/Maths_bai/article/details/6000744