RobotFramework框架系列 – 运行参数篇

2024-06-21 13:08

本文主要是介绍RobotFramework框架系列 – 运行参数篇,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

我们前文说了,RF有很强大的参数运行

rebot –help 可以得到如下的Option,我把常用的黄色标注,当然大家可以根据实际使用中进行选择

Options

=======

 

-R --merge When combining results, merge outputs together

instead of putting them under a new top level suite.

Example: rebot --merge orig.xml rerun.xml

-N --name name Set the name of the top level test suite. Underscores

in the name are converted to spaces. Default name is

created from the name of the executed data source.

-D --doc documentation Set the documentation of the top level test suite.

Underscores in the documentation are converted to

spaces and it may also contain simple HTML formatting

(e.g. *bold* and http://url/).

-M --metadata name:value * Set metadata of the top level suite. Underscores

in the name and value are converted to spaces. Value

can contain same HTML formatting as --doc.

Example: --metadata version:1.2

-G --settag tag * Sets given tag(s) to all executed test cases.

-t --test name * Select test cases by name or long name. Name is case

and space insensitive and it can also be a simple

pattern where `*` matches anything and `?` matches

any char. If using `*` and `?` in the console is

problematic, see --escape and –argumentfile.

 支持通配符 比如 “--test Example* ”就是以Example的case名称全部被选中

-s --suite name * Select test suites by name. When this option is used

with --test, --include or --exclude, only test cases

in matching suites and also matching other filtering

criteria are selected. Given name can be a simple

pattern similarly as with --test.

-i --include tag * Select test cases to by tag. Similarly as name with

--test, tag is case and space insensitive and it is

possible to use patterns with `*` and `?` as

wildcards. Tags and patterns can also be combined

together with `AND`, `OR`, and `NOT` operators.

Examples: --include foo --include bar*

--include fooANDbar*

-e --exclude tag * Select test cases not to be included by tag. These

tests are not selected even if included with

--include. Tags are matched using the rules explained

with --include.

--processemptysuite Processes output also if the top level test suite is

empty. Useful e.g. with --include/--exclude when it

is not an error that no test matches the condition.

-c --critical tag * Tests having given tag are considered critical. If no

critical tags are set, all tags are critical. Tags

can be given as a pattern like with --include.

-n --noncritical tag * Tests with given tag are not critical even if they

have a tag set with --critical. Tag can be a pattern.

-d --outputdir dir Where to create output files. The default is the

directory where Rebot is run from and the given path

is considered relative to that unless it is absolute.

-o --output file XML output file. Not created unless this option is

specified. Given path, similarly as paths given to

--log, --report and --xunit, is relative to

--outputdir unless given as an absolute path.

-l --log file HTML log file. Can be disabled by giving a special

name `NONE`. Default: log.html

Examples: `--log mylog.html`, `-l none`

-r --report file HTML report file. Can be disabled with `NONE`

similarly as --log. Default: report.html

-x --xunit file xUnit compatible result file. Not created unless this

option is specified.

--xunitskipnoncritical Mark non-critical tests on xUnit output as skipped.

-T --timestampoutputs When this option is used, timestamp in a format

`YYYYMMDD-hhmmss` is added to all generated output

files between their basename and extension. For

example `-T -o output.xml -r report.html -l none`

creates files like `output-20070503-154410.xml` and

`report-20070503-154410.html`.

--splitlog Split log file into smaller pieces that open in

browser transparently.

--logtitle title Title for the generated test log. The default title

is `<Name Of The Suite> Test Log`. Underscores in

the title are converted into spaces in all titles.

--reporttitle title Title for the generated test report. The default

title is `<Name Of The Suite> Test Report`.

--reportbackground colors Background colors to use in the report file.

Either `all_passed:critical_passed:failed` or

`passed:failed`. Both color names and codes work.

Examples: --reportbackground green:yellow:red

--reportbackground #00E:#E00

-L --loglevel level Threshold for selecting messages. Available levels:

TRACE (default), DEBUG, INFO, WARN, NONE (no msgs).

Use syntax `LOGLEVEL:DEFAULT` to define the default

visible log level in log files.

Examples: --loglevel DEBUG

--loglevel DEBUG:INFO

--suitestatlevel level How many levels to show in `Statistics by Suite`

in log and report. By default all suite levels are

shown. Example: --suitestatlevel 3

--tagstatinclude tag * Include only matching tags in `Statistics by Tag`

and `Test Details` in log and report. By default all

tags set in test cases are shown. Given `tag` can

also be a simple pattern (see e.g. --test).

--tagstatexclude tag * Exclude matching tags from `Statistics by Tag` and

`Test Details`. This option can be used with

--tagstatinclude similarly as --exclude is used with

--include.

--tagstatcombine tags:name * Create combined statistics based on tags.

These statistics are added into `Statistics by Tag`

and matching tests into `Test Details`. If optional

`name` is not given, name of the combined tag is got

from the specified tags. Tags are combined using the

rules explained in --include.

Examples: --tagstatcombine requirement-*

--tagstatcombine tag1ANDtag2:My_name

--tagdoc pattern:doc * Add documentation to tags matching given pattern.

Documentation is shown in `Test Details` and also as

a tooltip in `Statistics by Tag`. Pattern can contain

characters `*` (matches anything) and `?` (matches

any char). Documentation can contain formatting

similarly as with --doc option.

Examples: --tagdoc mytag:My_documentation

--tagdoc regression:*See*_http://info.html

--tagdoc owner-*:Original_author

--tagstatlink pattern:link:title * Add external links into `Statistics by

Tag`. Pattern can contain characters `*` (matches

anything) and `?` (matches any char). Characters

matching to wildcard expressions can be used in link

and title with syntax %N, where N is index of the

match (starting from 1). In title underscores are

automatically converted to spaces.

Examples: --tagstatlink mytag:http://my.domain:Link

--tagstatlink bug-*:http://tracker/id=%1:Bug_Tracker

--removekeywords all|passed|for|wuks|name:<pattern>|tag:<pattern> *

Remove keyword data from all generated outputs.

Keywords containing warnings are not removed except

in `all` mode.

all: remove data from all keywords

passed: remove data only from keywords in passed

test cases and suites

for: remove passed iterations from for loops

wuks: remove all but the last failing keyword

inside `BuiltIn.Wait Until Keyword Succeeds`

name:<pattern>: remove data from keywords that match

the given pattern. The pattern is matched

against the full name of the keyword (e.g.

'MyLib.Keyword', 'resource.Second Keyword'),

is case, space, and underscore insensitive,

and may contain `*` and `?` as wildcards.

Examples: --removekeywords name:Lib.HugeKw

--removekeywords name:myresource.*

tag:<pattern>: remove data from keywords that match

the given pattern. Tags are case and space

insensitive and it is possible to use

patterns with `*` and `?` as wildcards.

Tags and patterns can also be combined

together with `AND`, `OR`, and `NOT`

operators.

Examples: --removekeywords foo

--removekeywords fooANDbar*

--flattenkeywords for|foritem|name:<pattern>|tag:<pattern> *

Flattens matching keywords in all generated outputs.

Matching keywords get all log messages from their

child keywords and children are discarded otherwise.

for: flatten for loops fully

foritem: flatten individual for loop iterations

name:<pattern>: flatten matched keywords using same

matching rules as with

`--removekeywords name:<pattern>`

tag:<pattern>: flatten matched keywords using same

matching rules as with

`--removekeywords tag:<pattern>`

--starttime timestamp Set starting time of test execution when creating

reports. Timestamp must be given in format

`2007-10-01 15:12:42.268` where all separators are

optional (e.g. `20071001151242268` is ok too) and

parts from milliseconds to hours can be omitted if

they are zero (e.g. `2007-10-01`). This can be used

to override starttime of the suite when reports are

created from a single suite or to set starttime for

combined suite, which is otherwise set to `N/A`.

--endtime timestamp Same as --starttime but for ending time. If both

options are used, elapsed time of the suite is

calculated based on them. For combined suites,

it is otherwise calculated by adding elapsed times

of combined test suites together.

--nostatusrc Sets the return code to zero regardless of failures

in test cases. Error codes are returned normally.

--prerebotmodifier class * Class to programmatically modify the result

model before creating outputs.

-C --consolecolors auto|on|ansi|off Use colors on console output or not.

auto: use colors when output not redirected (default)

on: always use colors

ansi: like `on` but use ANSI colors also on Windows

off: disable colors altogether

Note that colors do not work with Jython on Windows.

-P --pythonpath path * Additional locations to add to the module search path

that is used when importing Python based extensions.

-E --escape what:with * Escape characters which are problematic in console.

`what` is the name of the character to escape and

`with` is the string to escape it with. Note that

all given arguments, incl. data sources, are escaped

so escape characters ought to be selected carefully.

Available escapes: amp (&), apos ('), at (@), bslash

(\), colon (:), comma (,), curly1 ({), curly2 (}),

dollar ($), exclam (!), gt (>), hash (#), lt (<),

paren1 ((), paren2 ()), percent (%), pipe (|), quest

(?), quot ("), semic (;), slash (/), space ( ),

square1 ([), square2 (]), star (*)

Examples:

--escape space:_ --metadata X:Value_with_spaces

-E space:SP -E quot:Q -v var:QhelloSPworldQ

-A --argumentfile path * Text file to read more arguments from. File can have

both options and data sources one per line. Contents

do not need to be escaped but spaces in the beginning

and end of lines are removed. Empty lines and lines

starting with a hash character (#) are ignored.

Example file:

| --include regression

| --name Regression Tests

| # This is a comment line

| my_tests.html

| path/to/test/directory/

-h -? --help Print usage instructions.

--version Print version information.

这篇关于RobotFramework框架系列 – 运行参数篇的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1081314

相关文章

eclipse运行springboot项目,找不到主类

解决办法尝试了很多种,下载sts压缩包行不通。最后解决办法如图: help--->Eclipse Marketplace--->Popular--->找到Spring Tools 3---->Installed。

22.手绘Spring DI运行时序图

1.依赖注入发生的时间 当Spring loC容器完成了 Bean定义资源的定位、载入和解析注册以后,loC容器中已经管理类Bean 定义的相关数据,但是此时loC容器还没有对所管理的Bean进行依赖注入,依赖注入在以下两种情况 发生: 、用户第一次调用getBean()方法时,loC容器触发依赖注入。 、当用户在配置文件中将<bean>元素配置了 lazy-init二false属性,即让

21.手绘Spring IOC运行时序图

1.再谈IOC与 DI IOC(lnversion of Control)控制反转:所谓控制反转,就是把原先我们代码里面需要实现的对象创 建、依赖的代码,反转给容器来帮忙实现。那么必然的我们需要创建一个容器,同时需要一种描述来让 容器知道需要创建的对象与对象的关系。这个描述最具体表现就是我们所看到的配置文件。 DI(Dependency Injection)依赖注入:就是指对象是被动接受依赖类

ABAP怎么把传入的参数刷新到内表里面呢?

1.在执行相关的功能操作之前,优先执行这一段代码,把输入的数据更新入内表里面 DATA: lo_guid TYPE REF TO cl_gui_alv_grid.CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'IMPORTINGe_grid = lo_guid.CALL METHOD lo_guid->check_changed_data.CALL M

java中查看函数运行时间和cpu运行时间

android开发调查性能问题中有一个现象,函数的运行时间远低于cpu执行时间,因为函数运行期间线程可能包含等待操作。native层可以查看实际的cpu执行时间和函数执行时间。在java中如何实现? 借助AI得到了答案 import java.lang.management.ManagementFactory;import java.lang.management.Threa

JavaWeb系列二十: jQuery的DOM操作 下

jQuery的DOM操作 CSS-DOM操作多选框案例页面加载完毕触发方法作业布置jQuery获取选中复选框的值jQuery控制checkbox被选中jQuery控制(全选/全不选/反选)jQuery动态添加删除用户 CSS-DOM操作 获取和设置元素的样式属性: css()获取和设置元素透明度: opacity属性获取和设置元素高度, 宽度: height(), widt

C语言入门系列:探秘二级指针与多级指针的奇妙世界

文章目录 一,指针的回忆杀1,指针的概念2,指针的声明和赋值3,指针的使用3.1 直接给指针变量赋值3.2 通过*运算符读写指针指向的内存3.2.1 读3.2.2 写 二,二级指针详解1,定义2,示例说明3,二级指针与一级指针、普通变量的关系3.1,与一级指针的关系3.2,与普通变量的关系,示例说明 4,二级指针的常见用途5,二级指针扩展到多级指针 小结 C语言的学习之旅中,二级

Java面试八股之JVM参数-XX:+UseCompressedOops的作用

JVM参数-XX:+UseCompressedOops的作用 JVM参数-XX:+UseCompressedOops的作用是启用对象指针压缩(Ordinary Object Pointers compression)。这一特性主要应用于64位的Java虚拟机中,目的是为了减少内存使用。在传统的64位系统中,对象引用(即指针)通常占用8字节(64位),而大部分应用程序实际上并不需要如此大的地址空间

JavaWeb系列六: 动态WEB开发核心(Servlet) 上

韩老师学生 官网文档为什么会出现Servlet什么是ServletServlet在JavaWeb项目位置Servlet基本使用Servlet开发方式说明快速入门- 手动开发 servlet浏览器请求Servlet UML分析Servlet生命周期GET和POST请求分发处理通过继承HttpServlet开发ServletIDEA配置ServletServlet注意事项和细节 Servlet注

如何实现一台机器上运行多个MySQL实例?

在一台机器上一个MySQL服务器运行多个MySQL实例有什么好处?这里我先入为主给大家介绍这样做至少存在两个好处(看完这篇文章后理解会更透彻): (1)减轻服务器链接负担 (2)为不同的用户提供不同的mysqld服务器的访问权限以方便这些用户进行自我管理。   下面我介绍具体的实现过程: 一、准备工作     台式机一台、Windows系统、MySQL服务器(我安装的版本是MySQL