Robotframework foundation Automation 6- 3 introduction Keyword

Keywords used when this section explain the assertion, the assertion is necessary to write test cases, test cases have not asserted that there is no soul.

一:Should Be Equal 

       Should Be Equal is used to determine whether the practice results and expected results are consistent. For example: Set a variable $ {a} = 1, then the assertion of a $ {a} are equal.

 At this time, the result must be run through, and if the variable $ {a} and 2 are compared, the result is certainly not pass.

Starting test: Testcase keyword describes test suite. 3..
20,191,224. 17: 01: 55.110: the INFO: $ = {A}. 1
20,191,224. 17: 01: 55.112: FAIL:! = 2. 1
Ending Test:. Testcase test suite keyword. introduction 3

二.Should Be True

    Should Be True if the return result is used to assert that is True, set the variable $ {a} = 1. Then the assertion $ {a} is equal to 2 if returns true, assert successful, false is returned if the assertion failure.

Starting test: Testcase test suite keyword describes 3..
20,191,224. 17: 28: 01.897: the INFO: $ = {A}. 1
20,191,224. 17: 28: 01.898: FAIL: Assertion failed
Ending test:.. Testcase test suite keyword describes 3

三 .Should Contain 

Should Contain is used to assert whether a string contains a string, fuzzy matching

helloworld string definitely does not contain apple character, it will be an assertion failure, if the apple will be successfully replaced hello

Starting test: Testcase keyword describes test suite. 3..
20,191,224. 17: 43 is: 07.227: the INFO: {A} = HelloWorld $
20,191,224. 17: 43 is: 07.228: FAIL: 'HelloWorld' does Not Contain 'Apple'
Ending Test: Testcase. test suite. keyword introduction 3

四.Should End With 

 Should End With section refers to the end of a string is not in the end we specify the characters.

Helloworld is not the same character at the end of the apple, if the apple into world will succeed.

Starting test: Testcase keyword describes test suite. 3..
20,191,224. 17: 48: 44.311: the INFO: {A} = HelloWorld $
20,191,224. 17: 48: 44.312: FAIL: 'HelloWorld' does with Not End 'Apple'
Ending Test: Testcase The test kit. keyword introduction 3

Five: Other assertions keywords

 

This figure Source: Robot Framework test automation framework core Guide

 

 

          No public attention for more updates

 

Guess you like

Origin www.cnblogs.com/zengxuejie/p/12085088.html