zoukankan      html  css  js  c++  java
  • 常用断言关键字(rf中)

    断言关键字

    描述

    Should Be Empty

    判断是否为空,如果不为空,执行失败,示例:

    ${value}

    Set Variable

    Hello

    Should Be Empty

    ${value}

    结果不为空

    Should Start With

    判断某个字符串是否以预期执行的字符串开始,如果以指定的字符串开头,则执行成功,否则执行失败,示例

    ${value}

    Set Variable

    Hello

    Should Start With

    ${value}

    qq

    字符串${value}不以qq开头

    Should Not Start With

    与Should Start With刚好相反,如果以指定的字符串开头,则执行失败,否则执行成功,示例:

    ${value}

    Set Variable

    Hello

    Should Not Start With

    ${value}

    qq

    字符串${value}是以qq开头

    Should Match

    判断某个字符串是否与预期指定的字符串相匹配,如果可以匹配,则执行成功,否则执行失败,示例:

    ${value}

    Set Variable

    Hello

    Should Match

    ${value}

    qq

    字符串${value}不可以匹配qq

    Should Not Match

    与Should Match刚好相反,如果字符串匹配,则执行失败,否则执行成功,示例:

    ${value}

    Set Variable

    Hello

    Should Match

    ${value}

    Hello

    字符串${value}可以匹配hello

    Should Contain X Times

    与Should Contain 关键字类似,用来判断指定的字符串包含指定的字符或者字符串多少次,示例:

    ${value}

    Set Variable

    hello

    Should Contain X Times

    ${value}

    hello

    3

    ${value}中没有3次包含字符串hello

    Should Be Equal As Integers

    以整数的形式来进行比较,示例:

    ${value}

    Set Variable

    12

    Should Be Equal As Integers

    ${value}

    13

    12和13不相等

    Should Be Equal As Strings

    以字符串的形式来进行比较,示例:

    ${value}

    Set Variable

    q

    Should Be Equal As Integers

    ${value}

    13

    q和13不相等

    Should Be Equal As Numbers

    以number的形式来进行比较,示例:

    ${value}

    Set Variable

    1.0

    Should Be Equal As Integers

    ${value}

    1

    1.0等于1

    Should Not Be Equal

    与should be equal 用法相反,当带比较的两个值相等时,执行失败,否则执行成功,示例:

    ${value}

    Set Variable

    1.0

    Should Not Be Equal

    ${value}

    1.0

    1.0等于1.0

    Should Not Be Empty

    与should be empty 用法相反,如果为空,执行失败,示例:

    ${value}

    Set Variable

    Hello

    Should Not Be Empty

    ${value}

    字符串${value}为空

  • 相关阅读:
    Android开发之Intent.Action
    package.json中版本号前的符号含义
    npm ERR! code 128
    前端vue项目添加单元测试及sonar配置
    npm ERR! code: 'EPERM' npm安装依赖时报错
    vue单文件中,解决相同ref出现多个的问题
    'NODE_ENV' 不是内部或外部命令,也不是可运行的程序 或批处理文件
    程序调试问题呈现
    Qt三维点云散点数据显示QtDataVisualization
    win环境下获取利用qt获取u盘信息
  • 原文地址:https://www.cnblogs.com/yjj727724/p/9476319.html
Copyright © 2011-2022 走看看