记录UI自动化Demo

基础语法实际记录例子
存在问题:网页多个frame嵌套下难以查找到元素;
         键盘操作不灵敏;
*** Settings ***
Library  C:\Users\Administrator\.PyCharm2018.3\system\python_stubs\266080405\win32api.py
Library  SeleniumLibrary
*** Variables ***
${server}  https://dhj.yingyuntech.com/UCenter-webapp/orderPlusLogin/init.htm?rqurl=/UCenter-webapp/orderPlusIndex/init.htm%3Foverdue=0
${browser}  Chrome
${username}  18200000001
${truePassWord}  123456
${errorPassWord}  654321
*** Test Cases ***
Login DHJ
     open browser  ${server}  ${browser}
     input text  id=username  ${username}
     input password  id=userpassword  ${truepassword}
     click link  xpath=//*[@id="loginbutton"]
     location should be  https://dhj.yingyuntech.com/UCenter-webapp/orderPlusLogin/init.htm?rqurl=/UCenter-webapp/orderPlusIndex/init.htm%3Foverdue=0
     log  login sueecc
Newbie guide
     sleep  2
     click link  xpath=//*[@id="noviceBoot1"]
     click link  xpath=//*[@id="noviceBoot2"]
     click link  xpath=//*[@id="noviceBoot3"]
     click link  xpath=//*[@id="noviceBoot4"]
 #    frame should contain  xpath=//*[@id="newFunctionTip"]/div[3]/a
     log  close NG SU
New feature alerts
     sleep  1
     click link  xpath=//*[@id="newFunctionTip"]/div[3]/a
   #  element should be visible    text=销售
     wait until page contains Element  xpath=//*[@id="wrapper"]/div[1]/div[2]/a    5  未找到元素
     log  close NFA SU
sale
     sleep  1
     mouse down   xpath=//*[@id="firstmenu"]/li[1]
    #   mouse down on image
    # click link  xpath=//*[@id="firstmenu"]/li[1]
     sleep  1
     click link  xpath=//*[@id="menuadd_100101"]
     maximize browser window
zhidaole
     sleep  2
     select frame  name=Sale-Add_iframe
     sleep  1
     click element  xpath=//*[@id="btnHardwareInfo"]/div/h1/a
 #    click element  xpath=//*[@id="crinputmore"]
Select Customers
    # select frame  name=Sale-Add_iframe
#     sleep  2
#     click element  xpath=//*[@id="crinputmore"]
     sleep  2
     input text  xpath=//*[@id="txbCr"]  001
     press key   xpath=//*[@id="tabdetail"]/tbody/tr[2]/td[2]/div/div/input   0206
     click element  xpath=//*[@id="buttomtable"]/tbody/tr[3]/td[2]/div


#     click element  xpath=//*[@id="autoComplete_Group_0.7353889508205909"]/table/tbody/tr[1]
#     click button  xpath=//*[@id="0"]

#choose products
  #   mouse over  xpath=//*[@id="tabdetail"]/tbody/tr[2]/td[2]/div/div/input
   #  click button  xpath=//*[@id="tabdetail"]/tbody/tr[2]/td[2]/div/a
   #  switch to context  id=iframe
   #  select frame  xpath=//*[@id="iframe"]
#     switch to   id=iframe
#     sleep  2
#     select frame  name=Sale-Add_iframe
#     click element  xpath=//*[@id="linkchooseproduct"]
#    sleep  1
#     select checkbox  xpath=//*[@id="fcheckbox1"]
#    click button  xpath=//*[@id="listButtonDiv"]/a[3]
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值