Example robot by executing common commands (rpm)

Excuting an order

  • Performing a use case

robot -t “testcase_name“ data_test.robot

  • Example performed with a document

robot data_test.robot
或者
robot --suite “prjxx.robot.data test" test_directory

  • All the use cases perform directory

robot test_directory
or
python -m robot test_directory

  • EXAMPLE executed in the execution tag

robot --include smoke test_directory
robot --include smoke path/test_file.robot

  • Example execution culling

robot --exclude smoke test_directory
或者
robot --exclude smoke path/test_file.robot

  • Running out of order

Can effectively avoid the dependency between the testcase, independence is the key to sustained and effective testcase
robot --randomize tests path / test_file.robot

  • Variable parameters

Can update a plurality of variables, each run to reach different contents of the object, for example, the environment may be switched, switching the data through commands
robot --variable ENV: uat --variable TEST_DATA: uat regression.robot

 

 

The results are reported

 

  • Generate performance reports

Generated by default to the current directory, it contains output.xml, log.html, report.html
may each modify their parameters are as follows:
--outputdir (-d)
--output Output.xml 
--report report.html
--log log.html

You do not want a report can set None, for example:

--output NONE --report NONE --log NONE

 
  • The results positioning

Different results have different execution result code (RC), used to quickly locate problem

RC  Explanation
0   全部通过
1-249 出现250个内的错误用例 250 出现250个内的错误用例 251 帮助信息打印 252 异常测试数据 253 用户中断了执行 255 无法识别的异常
  • The combined results file

rebot -N new_report.html -o new_output.xml 1st_output.xml 2nd_output.xml

  • All results are consolidated under the directory

python -m robot.rebot --name Combined outputs/*.xml

  • Extraction integration test results

rebot --log smoke_log.html --report smoke_report.html --include smoke
--ReportTitle Smoke_Tests --ReportBackground green:yellow:red
--TagStatCombine tag1ANDtag2 path/to/myoutput.xml

 

Data generated

  • Output current framework lib library documentation

python -m robot.libdoc OperatingSystem OperatingSystem.html

  • Generates use case documents

python -m robot.testdoc xxx_prj1.robot/*.robot testcasedoc.html

 

 

Transfer:  https://blog.51cto.com/7717647/2089045

Guess you like

Origin www.cnblogs.com/leozhanggg/p/11310477.html
Recommended