html tool

2017年10月25日星期三

robotframe 内嵌关键字的用法补遗IV


http://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Run%20Keyword%20If%20Any%20Critical%20Tests%20Failed



Pass Execution logname ${escaped}
无条件忽略执行此关键字,说明中给定的条件是
When used in any setup or teardown (suite, test or keyword), passes that setup or teardown. Possible keyword teardowns of the started keywords are executed. Does not affect execution or statuses otherwise.
When used in a test outside setup or teardown, passes that particular test case. Possible test and keyword teardowns are executed.
但自己还是不太理解这样的场景。感觉和注释符似的
Pass Executionmessage, *tags
Pass Execution If 1==1 logname ${escaped}Pass Execution Ifcondition, message,*tags
${escaped} = Regexp Escape f$o^o$b[a]r()?\\
logname ${escaped}
给字符串中元字符设置转义符
Regexp Escape*patterns
Reload Libraryname_or_instance
Set Tags TTTT
logname @{TEST TAGS}
Set Tags TTTTaaa
Remove Tags TTTT
logname @{TEST TAGS}
Remove Tags*tags
Repeat Keyword 5x logname aaaaRepeat Keywordrepeat, name, *args
?没太明白这个Replace Variables 在any object 如何使用,
下面是String 测试通过了
${FileCon}= logname resaaaa
${message}= Replace Variables ${FileCon}
logname ${message}
Replace Variablestext
同下Return From Keyword*return_values
Return test
[Arguments] ${element}
@{items}= Create List aa bb cc test tt apass
${index}= Set Variable ${0}
:FOR ${item} IN @{items}
\ Return From Keyword If '${item}'=='${element}' ${index}
\ ${index}= Set Variable ${index + 1}
Return From Keyword ${-1} #Also [Return] word work here.
Return From Keyword Ifcondition,*return_values
Run Keyword logname ${var}Run Keywordname, *args
Run Keyword And Continue On Failure wait logname ${var}
Run Keyword And Continue On Failure Fail
logname ${var}
Run Keyword And Continue On Failurename, *args

没有评论:

发表评论