当前位置:网站首页>Run Keyword If 使用详解
Run Keyword If 使用详解
2022-07-20 07:19:00 【51CTO】
5.1 语句简介
robotframework中的if语句是使用关键字Run Keyword If来代替的
Run Keyword If
函数释义:如果给出的判断条件满足,就执行给出的关键字。
函数结构范例:
Run Keyword If 判断条件 其他关键字
... ELSE IF 判断条件 其他关键字
... ELSE 判断条件 其他关键字
5.2使用示例
示例演示使用软件版本:robotframework2.7.5,ride1.1
5.2.1判断条件—数字对比
5.2.2判断条件—字符对比
注意:
1.变量${var}值为字符时,在判断条件中其需要加单引号或双引号(如上图红色框中所示),为’${var}’或者”${var}”。
2.在判断条件中,与变量${var}对比的字符常量也需要加单引号或双引号,为’tttt’或者”tttt”。
5.2.3判断条件—布尔类型对比
注意:
1.变量${var}值为true或false时,在判断条件中其需要加单引号或双引号,为’${var}’或者”${var}”。
2.在判断条件中,与变量${var}对比的布尔值也需要加单引号或双引号,为’${true}’或者”${true}”。
5.2.4判断条件—列表是否包含元素
注意:
1.变量${string}值为字符时,在判断条件中其需要加单引号或双引号,为’${string}’或者”${string}”。
5.2.5判断条件—列表与列表是否相等对比
5.2.6判断条件—列表元素对比
注意:
1.列表元素值(如上图中@{varlist2}[1])为字符时,在判断条件中其需要加单引号或双引号,如下图中@{varlist2}[1],变为’@{varlist2}[1]’或者”@{varlist2}[1]”。
5.2.7执行多个判断条件
边栏推荐
猜你喜欢
[team PK competition] the points mall has been opened | exchange exclusive gifts now
MySQL的增删查改【进阶】
C language dynamic memory management
Kubernetes deploys single node redis service
数论基础-
2022.07.19 (lc_; sword finger offer II 041. Average value of sliding window)
C reflection and factory mode
First meeting, MySQL
每日一题·731.我的日程安排表||·数组
ACM warm-up exercise 3 in summer vacation 2022
随机推荐
vulntarget漏洞靶场-vulntarget-b
[learning notes] arc144
[translation] thinking about machine learning engineering after a year of doctoral study
利用哈希来解决问题
2022.07.19(LC_剑指 Offer II 041. 滑动窗口的平均值)
Topological sorting-
【QNX Hypervisor 2.2用户手册】目录
Don't use the line segment tree to solve all my schedule problems with one idea
不用线段树,一个思路解决所有我的日程安排表问题
Top ten best automated test tools in the world in 2022
MYSQL插入中文出错的解决办法
创建K26 SOM最小系统
localtime()
程序环境和预处理
Force buckle 745 Prefix and suffix search
Unicode encoding output 12 zodiac emoticons
[learning notes] agc016
Openmv receives STM32 MCU data
03 BeautifulSoup解析库
oracle常用命令