在这里积累学习中的点点滴滴!

第一个APP测试脚本-登录

上一篇 / 下一篇  2018-03-09 15:09:51 / 个人分类:RFS+Appiumlibrary


_r"o V9]E!o;V|0测试,对于工具的初步了解第一个尝试的脚本肯定是登录了,先上脚本
k?DW5Id{Z01、打开app检查页面是否有【我的】文字信息51Testing软件测试网e2U'xm Uch C
2、点击【我的】tab,检查页面有【未登录】文字信息51Testing软件测试网9J4O4z3m1}bP.O
3、点击【未登录】进入登录页面51Testing软件测试网I,V5@kcI
4、输入账号【18700000000】51Testing软件测试网["Ml xt'D2Ut

0D [Q(Zc(WD6A0登录51Testing软件测试网?&}{7X En8o
    open application    http://localhost:4723/wd/hub    platformName=Android    platformVersion=4.2.2    deviceName=10.0.1.128:5555    app=${CURDIR}/xxxx.apk51Testing软件测试网^+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"D
2、使用UI Automator Viewer工具可以查看APP页面中的元素便于定位,"C:\Program Files (x86)\Android\android-sdk\tools\uiautomatorviewer.bat"。51Testing软件测试网(d+p1f/iP6lF|c
3、APP中常用的content-desc属性,可以在脚本中当作name,id属性直接使用。51Testing软件测试网b{0Nmt |o
4、元素属性识别大小写,当时就因为定位文本框时index首字母大写了导致花费了很多时间排查问题。51Testing软件测试网gVj?.i m*o!]
51Testing软件测试网$^ L} E2_ov8?:y
51Testing软件测试网1T |#k9gg-j A.I

Vr}$v'O0

TAG:

jin51testing的个人空间 引用 删除 jin51testing   /   2018-03-12 17:09:37
1
 

评分:0

我来说两句

Open Toolbar