zoukankan      html  css  js  c++  java
  • RobotFramework常见语法

    https://blog.csdn.net/yu1014745867/article/details/79324732

    常用关键字
    * Settings *

    Library Selenium2Library
    1
    * Keywords *

    打开浏览器
    [Arguments] ${url} ${browser}
    [Documentation] 打开浏览器
    open browser ${url} ${browser}
    1
    2
    3
    最大化窗口
    [Documentation] 最大化窗口
    Maximize Browser Window
    1
    2
    等待时间
    [Arguments] ${time}
    [Documentation] 等待时间
    sleep ${time}
    1
    2
    3
    文本框输入
    [Arguments] ${location} ${value}
    [Documentation] 文本框输入
    input text ${location} ${value}
    1
    2
    3
    点击按钮
    [Arguments] ${location}
    [Documentation] 点击按钮
    click button ${location}
    1
    2
    3
    点击元素
    [Arguments] ${location}
    [Documentation] 点击元素
    click element ${location}
    1
    2
    3
    点击链接
    [Arguments] ${location}
    [Documentation] 点击链接
    click link ${location}
    1
    2
    3
    鼠标滑动
    [Arguments] ${location}
    [Documentation] 鼠标滑动
    mouse over ${location}
    1
    2
    3
    截图
    [Documentation] 截图
    Capture Page Screenshot
    1
    2
    执行js
    [Arguments] ${JSContent}
    [Documentation] 执行JS
    Execute JavaScript ${JSContent}
    1
    2
    3
    选择Frame
    [Arguments] ${location}
    [Documentation] 选择Frame
    Select Frame ${location}
    1
    2
    3
    等待元素
    [Arguments] ${location} ${time} ${error} # 元素|等待时间|输出错误
    [Documentation] 等待元素
    wait until element is visible ${location} ${time} ${error}
    1
    2
    3
    4
    勾选框
    [Arguments] ${location}
    [Documentation] 勾选框
    Select Checkbox ${location}
    1
    2
    3
    单选框
    [Arguments] ${group} ${value}
    [Documentation] 单选框
    Select Radio Button ${group} ${value}
    1
    2
    3
    复选框选择
    [Arguments] ${type} ${location} @{value} # type:label、value,按照label还是value来定位,默认为label
    [Documentation] 复选框选择
    run keyword if ${type}=='value' Select From List By value ${location} @{value}
    else Select From List By label ${location} @{value}
    [Teardown]
    1
    2
    3
    4
    5
    下拉框选择
    [Arguments] ${type} ${location} @{value} # type:label、value,按照label还是value来定位,默认为label
    [Documentation] 下拉框选择
    run keyword if ${type}=='value' Select From List By value ${location} @{value}
    else Select From List By label ${location} @{value}
    [Teardown]
    1
    2
    3
    4
    5
    判断文本正确性
    [Arguments] ${location} ${expected}
    [Documentation] 判断文本正确性
    element text should be ${location} ${expected}
    1
    2
    3
    循环
    if循环
    Run Keyword If '${addr.status_code}' == '200' Log 接口返回状态码正常
    ... ELSE Log 接口返回状态码错误!
    ————————————————
    版权声明:本文为CSDN博主「ElenaYu」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/yu1014745867/article/details/79324732

  • 相关阅读:
    ExtJS 4布局
    ExrJS4学习笔记1 类
    Jquery实现动态添加按钮
    ExtJs 4 MVC
    读取目录下所有目录和文件加载到TreeView
    利用List的Sort()、Find()、FindAll()、Exist()來解決一些問題
    html常用
    ExtJs3.3 TreePanel,checked节点和平常节点同时存在
    sql server 常用查询
    美女时钟网页代码
  • 原文地址:https://www.cnblogs.com/wushujun/p/11677817.html
Copyright © 2011-2022 走看看