在这里积累学习中的点点滴滴!
第一个APP测试脚本-登录
上一篇 /
下一篇 2018-03-09 15:09:51
/ 个人分类:RFS+Appiumlibrary
51Testing软件测试网L%[d5Q2kR做
测试,对于工具的初步了解第一个尝试的脚本肯定是登录了,先上脚本
fJ2`S ?01、打开
app检查页面是否有【我的】文字信息
:V;[#{G
h%qM*`02、点击【我的】tab,检查页面有【未登录】文字信息
51Testing软件测试网~DO3g\,\*X^ a(q3、点击【未登录】进入登录页面
G7H"},ymZ04、输入账号【18700000000】
&Yn_"k]03h.RIQQ?.v3?_#j0登录
51Testing软件测试网ClvkZis open application http://localhost:4723/wd/hub platformName=Android platformVersion=4.2.2 deviceName=10.0.1.128:5555 app=${CURDIR}/xxxx.apk
51Testing软件测试网{$m,aWXw0^
{r3N sleep 3s
&iP^2K8@-A0 Wait Until Page Contains Element xPath=//android.view.View[@content-desc='我的']
51Testing软件测试网9M!v/{2Mc+b8WWf click element xPath=//android.view.View[@content-desc='我的']
51Testing软件测试网4H-I3bG9bw
`+})@ Wait Until Page Contains Element xPath=//android.view.View[@content-desc='未登录']
51Testing软件测试网)\N#BO} click element xPath=//android.view.View[@content-desc='未登录']
51Testing软件测试网ylo"r:La input text xPath=//android.widget.EditText[@index='0'] 18700000000
/j v|c*W4b R7n051Testing软件测试网x(C x@8bw1b{0a注意事项:
51Testing软件测试网J.yM!B,W4^r _"m/b1、open application 关键字用于打开app,如果未安装则根据配置路径安装app并打开。
mX2Di v,s1g7~02、使用UI Automator Viewer工具可以查看APP页面中的元素便于定位,"C:\Program Files (x86)\Android\android-sdk\tools\uiautomatorviewer.bat"。
51Testing软件测试网b
DD:c}2}e3、APP中常用的content-desc属性,可以在脚本中当作name,id属性直接使用。
.DL\[c L04、元素属性识别大小写,当时就因为定位文本框时index首字母大写了导致花费了很多时间排查问题。
51Testing软件测试网E9V*`y.I-wq51Testing软件测试网hZ7ZT`;Hd(B?"r'HUPpC^5D}051Testing软件测试网2w,jG.RO NmO
收藏
举报
TAG: