• 【RobotFramework自动化测试】RFS常用脚本


    读取后台数据文件:Import Variables | ${CURDIR}/\ABC.py

    定位页面:Wait Until Keyword Succeeds | 5s | 500ms | select window | url = %Index.aspx%/title = 
     
    xpath定位:xpath=//button[text()="查找"]
                     xpath=//input[@name='Jbr']/parent::*/parent::*/td[2]/img
     
    FOR循环:
          ${local_J}     Evaluate     len(${ABC})     #获得数组参数的个数     
          : FOR     ${local_I}     IN RANGE     ${local_J}     #for循环,遍历所有参数
                       修改合约规划信息     title=选择合约规划     ${ABC[${local_I}][0]}     ${ABC[${local_I}][1]}
     
    验证不通过继续执行:Run Keyword And Continue On Failure
     
    页面值校验:Textfield Value Should Be | ABC | ${ABC_Check} | message=结果值对比错误!
     
    编辑框基本输入:Input Text
     
    Alert点击(常规方式):Confirm Action
    Alert点击(非常规方式):
           Win Activate | 页面Title | 页面文字内容     
           Control Click | 页面Title | 按钮中文名称 | 按钮英文名称
     
    上传图片:
        click element    //input[@class="id_observe"]    #点击身份证正面上传
        sleep    1s
        Win Wait    打开
        sleep    1s
        Win Activate    打开
        Control Set Text    \    \    Edit1    ${filename_observe}
        Control Click    \    \    Button1
  • 相关阅读:
    If you want the rainbow, you have to deal with the rain.
    Yesterday is history, tomorrow is a mystery, but today is a gift.
    .bashrc修改环境变量文件后ls之类的不能用了
    Flask项目中使用mysql数据库启动项目是发出警告
    flask 编码问题
    flask 密钥问题
    Flask 数据库连接
    查看cpu核的相关信息
    top命令常用
    gluster设置日志级别
  • 原文地址:https://www.cnblogs.com/BIGMOM/p/4326055.html
Copyright © 2020-2023  润新知