码迷,mamicode.com
首页 > 其他好文 > 详细

3. Robot framework 内置库

时间:2020-06-03 14:01:50      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:class   退出   lua   tag   eval   python   ali   convert   put   

一、BuiltIn库中比较重要的关键字

1. Evaluate关键字

  如果你需要进行一些数值运算并得到结果,你就需要用到Evaluate关键字。Evaluate会把你想要计算的表达式直接传递给Python,并把Python的计算结果返回给你。这是最经常要用到的,自动导入无需import

2. Should 系列关键字:

  Should系列关键字是Should大头的一系列关键字 Should Be Empty · Should Be Equal · Should Be Equal As Integers · Should Be Equal As Numbers · Should Be Equal As Strings · Should Be True · Should Contain · Should Contain X Times· Should End With · Should Match · Should Match Regexp · Should Not Be Empty · Should Not Be Equal · Should Not Be Equal As Integers · Should Not Be Equal As Numbers · Should Not Be Equal As Strings · Should Not Be True · Should Not Contain · Should Not End With · Should Not Match ·Should Not Match Regexp · Should Not Start With · Should Start With 

3. Convert To系列关键字:  Convert To Binary · Convert To Boolean · Convert To Hex · Convert To Integer · Convert To Number · Convert To Octal · Convert To String 做类型转换比不可少。

4. Run keyword系列关键字:  Run Keyword If · Run Keyword If All Critical Tests Passed · Run Keyword If All Tests Passed · Run Keyword If Any Critical Tests Failed ·Run Keyword If Any Tests Failed · Run Keyword If Test Failed · Run Keyword If Test Passed · Run Keyword If Timeout Occurred ·

这些关键字能根据一个判断条件的真假来看是否执行关键字。一般使用这些关键字来实现高级语言中的if else功能。最常用的是Run Keyword If 和 Run Keyword unless 他们俩实现的效果正好相反

5. Exit For Loop关键字: 用作退出循环,一般和Run keyword if 关键字联合使用,来实现条件退出

二、String库中常用关键字

  • Convert To Lowercase
  • Convert To Uppercase
  • Decode Bytes To String
  • Encode String To Bytes
  • Fetch From Left
  • Fetch From Right
  • Generate Random String
  • Get Line
  • Get Line Count
  • Get Lines Containing String
  • Get Lines Matching Pattern
  • Get Lines Matching Regexp
  • Get Regexp Matches
  • Get Substring
  • Remove String
  • Remove String Using Regexp
  • Replace String
  • Replace String Using Regexp
  • Should Be Byte String
  • Should Be Lowercase
  • Should Be String
  • Should Be Titlecase
  • Should Be Unicode String
  • Should Not Be String
  • Split String
  • Split String From Right
  • Split String To Characters
  • Split To Lines
  • Strip String

三、 Collections库

  • Append To List
  • Combine Lists
  • Convert To Dictionary
  • Convert To List
  • Copy Dictionary
  • Copy List
  • Count Values In List
  • Dictionaries Should Be Equal
  • Dictionary Should Contain Item
  • Dictionary Should Contain Key
  • Dictionary Should Contain Sub Dictionary
  • Dictionary Should Contain Value
  • Dictionary Should Not Contain Key
  • Dictionary Should Not Contain Value
  • Get Dictionary Items
  • Get Dictionary Keys
  • Get Dictionary Values
  • Get From Dictionary
  • Get From List
  • Get Index From List
  • Get Match Count
  • Get Matches
  • Get Slice From List
  • Insert Into List
  • Keep In Dictionary
  • List Should Contain Sub List
  • List Should Contain Value
  • List Should Not Contain Duplicates
  • List Should Not Contain Value
  • Get Dictionary Items
  • Get Dictionary Keys
  • Get Dictionary Values
  • Get From Dictionary
  • Get From List
  • Get Index From List
  • Get Match Count
  • Get Matches
  • Get Slice From List
  • Insert Into List
  • Keep In Dictionary
  • List Should Contain Sub List
  • List Should Contain Value
  • List Should Not Contain Duplicates
  • List Should Not Contain Value

四、 OperatingSystem

  • Append To Environment Variable
  • Append To File
  • Copy Directory
  • Copy File
  • Copy Files
  • Count Directories In Directory
  • Count Files In Directory
  • Count Items In Directory
  • Create Binary File
  • Create Directory
  • Create File
  • Directory Should Be Empty
  • Directory Should Exist
  • Directory Should Not Be Empty
  • Directory Should Not Exist
  • Empty Directory
  • Environment Variable Should Be Set
  • Environment Variable Should Not Be Set
  • File Should Be Empty
  • File Should Exist
  • File Should Not Be Empty
  • File Should Not Exist
  • Get Binary File
  • Get Environment Variable
  • Get Environment Variables
  • Get File
  • Get File Size
  • Get Modified Time
  • Grep File
  • Should Not Exist
  • Split Extension
  • Split Path
  • Touch
  • Wait Until Created
  • Wait Until Removed
  • Join Path
  • Join Paths
  • List Directory
  • List Files In Directory
  • Log Environment Variables
  • Log File
  • Move Directory
  • Move File
  • Move Files
  • Normalize Path
  • Remove Directory
  • Remove Environment Variable
  • Remove File
  • Remove Files
  • Run
  • Run And Return Rc
  • Run And Return Rc And Output
  • Set Environment Variable
  • Set Modified Time
  • Should Exist
  • List Directories In Directory

五、 Process库

  • Get Process Id
  • Get Process Object
  • Get Process Result
  • Is Process Running
  • Join Command Line
  • Process Should Be Running
  • Process Should Be Stopped
  • Run Process
  • Send Signal To Process
  • Split Command Line
  • Start Process
  • Switch Process
  • Terminate All Processes
  • Terminate Process
  • Wait Get Process Id
  • Get Process Object
  • Get Process Result
  • Is Process Running
  • Join Command Line
  • Process Should Be Running
  • Process Should Be Stopped
  • Run Process
  • Send Signal To Process
  • Split Command Line
  • Start Process
  • Switch Process
  • Terminate All Processes
  • Terminate Process
  • Wait For Process

六、XML库

  • Add Element
  • Clear Element
  • Copy Element
  • Element Attribute Should Be
  • Element Attribute Should Match
  • Element Should Exist
  • Element Should Not Exist
  • Element Should Not Have Attribute
  • Element Text Should Be
  • Element Text Should Match
  • Element To String
  • Elements Should Be Equal
  • Elements Should Match
  • Evaluate Xpath
  • Get Child Elements
  • Get Element
  • Get Element Attribute
  • Get Element Attributes
  • Get Element Count
  • Get Element Text
  • Get Elements
  • Get Elements Texts
  • Log Element
  • Parse Xml
  • Remove Element
  • Remove Element Attribute
  • Remove Element Attributes
  • Remove Elements
  • Remove Elements Attribute
  • Remove Elements Attributes
  • Save Xml
  • Set Element Attribute
  • Set Element Tag
  • Set Element Text
  • Set Elements Attribute
  • Set Elements Tag
  • Set Elements Text

 

3. Robot framework 内置库

标签:class   退出   lua   tag   eval   python   ali   convert   put   

原文地址:https://www.cnblogs.com/zhangan/p/13036780.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!