Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Robot use case executes common commands

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report