• 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

  • 相关阅读:
    Android实战技巧之四十九:Usb通信之USB Host
    Netty in Action (七) 第三章节 Netty组件和设计
    打造敏捷的自组织团队
    Cocos2d-x移植到Android平台编译的两个文件Android.mk和Application.mk
    Codeforces Round #306 (Div. 2) (ABCE题解)
    事情非常重要却总不想開始怎么办
    <html>
    Android中Activity与Task相关的属性解析
    大话设计模式—策略模式
    android hander怎样避免内存泄露
  • 原文地址:https://www.cnblogs.com/wushujun/p/11677817.html
Copyright © 2020-2023  润新知