在这里积累学习中的点点滴滴!
第一个APP测试脚本-登录
上一篇 /
下一篇 2018-03-09 15:09:51
/ 个人分类:RFS+Appiumlibrary
_r"oV9]E!o;V|0做
测试,对于工具的初步了解第一个尝试的脚本肯定是登录了,先上脚本
k?DW5Id{Z01、打开
app检查页面是否有【我的】文字信息
51Testing软件测试网 e2U'xmUch C2、点击【我的】tab,检查页面有【未登录】文字信息
51Testing软件测试网9J4O4z3m1}bP.O3、点击【未登录】进入登录页面
51Testing软件测试网I,V5@kcI4、输入账号【18700000000】
51Testing软件测试网["Ml xt'D2Ut0D[Q(Zc(WD6A0登录
51Testing软件测试网?&}{7XEn8o open application http://localhost:4723/wd/hub platformName=Android platformVersion=4.2.2 deviceName=10.0.1.128:5555 app=${CURDIR}/xxxx.apk
51Testing软件测试网^+hU M7K sleep 3s
0ger9H?i+Q0 Wait Until Page Contains Element xPath=//android.view.View[@content-desc='我的']
51Testing软件测试网#`I4q8j|{+w click element xPath=//android.view.View[@content-desc='我的']
51Testing软件测试网I7u(x"Udq Wait Until Page Contains Element xPath=//android.view.View[@content-desc='未登录']
#V%[9{ oQTU0 click element xPath=//android.view.View[@content-desc='未登录']
q+O,q ^ |f0 input text xPath=//android.widget.EditText[@index='0'] 18700000000
Y,W:u ^NPy[0|YfZmu!Ge0注意事项:
[~c&rk:U01、open application 关键字用于打开app,如果未安装则根据配置路径安装app并打开。
51Testing软件测试网T+p$r
|"N(mEK3H"D2、使用UI Automator Viewer工具可以查看APP页面中的元素便于定位,"C:\Program Files (x86)\Android\android-sdk\tools\uiautomatorviewer.bat"。
51Testing软件测试网(d+p1f/iP6lF|c3、APP中常用的content-desc属性,可以在脚本中当作name,id属性直接使用。
51Testing软件测试网b{0Nmt|o4、元素属性识别大小写,当时就因为定位文本框时index首字母大写了导致花费了很多时间排查问题。
51Testing软件测试网gVj?.im*o!]51Testing软件测试网$^L} E2_ov8?:y51Testing软件测试网1T |#k9gg-jA.IVr}$v'O0
收藏
举报
TAG: