Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Robot use case executes common commands

Shulou Source: shulou.com Published: 2022-06-03 03:10:13 10月02日 Update

Execute a command to execute a use case

Robot-t "testcase_name" data_test.robot

Execute by use case file

Robot data_test.robot

Or robot-- suite "prjxx.robot.data test" test_directory

Execute all use cases in the directory

Robot test_directory

Or python-m robot test_directory

Execute the use case by executing tag

Robot-include smoke test_directory

Robot-include smoke path/test_file.robot

Eliminate use case execution

Robot-exclude smoke test_directory

Or

Robot-exclude smoke path/test_file.robot

Run out of order

It can effectively avoid the dependence between testcase, and maintaining independence is the key to the continued effectiveness of testcase.

Robot-randomize tests path/test_file.robot

Variable parameter

You can update multiple variables to achieve the goal of different content for each run, for example, you can switch environments, data and so on through commands.

Robot-variable ENV:uat-variable TEST_DATA:uat regression.robot

Result report generate execution report

Generated to the current directory by default, including output.xml, log.html, and report.html

You can modify them separately. The parameters are as follows:

-- outputdir (- d)

-- output output.xml

-- report report.html

-- log log.html

If you don't want a report, you can set None, for example:

-- output NONE-- report NONE-- log NONE result location

Different execution results will have different result codes (RC), which are used to quickly locate the problem.

RC Explanation0 all through 1-249 within 250 error use cases 250 within 250 error use cases 251 help information print 252exception test data 253user interrupted the execution of 255unrecognized exception merge result file

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

Merge all the results in the directory

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

Extract integrated 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 generation output lib library description document of the current framework

Python-m robot.libdoc OperatingSystem OperatingSystem.html

Generate use case documents

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

Tags: Results generation reports directories commands different valid parameters variables data files documents switching positioning testing between code information key content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information NVidia Redmi MariaDB OPPO Reno