美文网首页
[QA]Robot Framework

[QA]Robot Framework

作者: yumiii_ | 来源:发表于2019-04-01 16:31 被阅读0次
  1. 常用关键词
    关键字不区分大小写
    Create Session
    Get Request
    Post Request
    Create Dictionary
    get from dictionary
    Should Be Equal As Strings
    to json
    runkeyword if 【if判断】
    ... else

参考文档:
BuiltIn
RequestsKeywords
Robot Framework documentation

2.声明变量用${变量名},声明List型变量用@{变量名}或者${变量名}都可以,**如果用@{变量名}声明列表,用log many而不是log打印此列表。实际上也可以在接收List值后转化成List变量。

3.get time

4.run keyword if 一定要注意空格。。。。

${score}  set variable  95
Run Keyword If  ${score}>90  log  优秀
...  ELSE IF  ${score}>60  log  及格
...  ELSE  log  不及格
  1. for循环
@{range_list}  Create List  3  4  5  7
:FOR  ${item}  in  @{range_list}
\  log  ${item}

一定要记住:In RF statements which are suppose to execute inside for loop are followed with the \ with tab

6.Evaluate调用python的库

${d}  Evaluate  random.randint(100,300)  random
log  ${d}

可以在后面指定



但是我们尽量把要用的封装成关键字传给RF

验证的信息一般为状态码和返回的信息。

相关文章

网友评论

      本文标题:[QA]Robot Framework

      本文链接:https://www.haomeiwen.com/subject/rwevbqtx.html