工作需要,重回RF怀抱,对robot这个工具有使用需求,所以研究了下它的帮助文件,靠着个人和谷歌,翻译了一下帮助文件,仅供参考,如有错误,望大佬不吝指正。
全文翻译如下:
robot --helpRobot Framework -- A generic automation frameworkVersion: 4.1.3 (Python 3.8.10 on linux)Usage: robot [options] pathsor: python -m robot [options] pathsor: python path/to/robot [options] pathsor: java -jar robotframework.jar [options] pathsRobot Framework is a generic open source automation framework for acceptance testing, acceptance test-driven development (ATDD) and robotic process automation (RPA). It has simple, easy-to-use syntax that utilizes the keyword-driven automation approach. Keywords adding new capabilities areimplemented in libraries using either Python or Java. New higher level keywords can also be created using Robot Framework's own syntax.// Robot Framework是一个用于接收测试、测试驱动开发(ATDD)、机器人流程自动化(RPA)的开源的自动化测试框架。它语法简单易用,利用关键字驱动的自动化方法。可以用Python或Java的库添加新功能的关键字,可以使用RF自己的语法创建更高级别的关键字。The easiest way to execute Robot Framework is using the `robot` command created as part of the normal installation. Alternatively it is possible to execute the `robot` module directly like `python -m robot`, where `python` can be replaced with any supported Python interpreter such as `jython`, `ipy` or`python3`. Yet another alternative is running the `robot` directory like `python path/to/robot`. Finally, there is a standalone JAR distribution available.// 最简单执行RF的方法是使用robot命令,它作为正常安装的一部分被创建。或者是它可以通过robot模块被执行,像`python -m robot`,其中python可以被支持Python解析器的jpython、ipy、或python3替代,当然其他选择也可以是通过robot目录来执行,像`python path/to/robot`。最后,还有一个独立的Jar发行版可以使用。Tests (or tasks in RPA terminology) are created in files typically having the `*.robot` extension. Files automatically create test (or task) suites and directories with these files create higher level suites. When Robot Framework is executed, paths to these files or directories are given to it as arguments.// 测试(或RPA术语的任务)是以文件形式被创建,拥有`*.robot`扩展类型。文件自动创建测试(或任务)套件,并且包含这些文件的目录可以创建更高级的套件。当RF执行时,包含文件或目录的路径需要作为参数传递给RF。By default Robot Framework creates an XML output file and a log and a report in HTML format, but this can be configured using various options listed below. Outputs in HTML format are for human consumption and XML output for integration with other systems. XML outputs can also be combined and otherwise furtherpost-processed with the Rebot tool that is an integral part of Robot Framework.// RF默认创建XML格式的output文件,log和report文件是HTML格式,但是这些配置用户可以通过如下选项进行修改。HTML格式的Output文件可供测试人员使用,而XML格式的Output则是用于其他系统集成。XML格式的Output也可以组合,通过RF不可或缺的一部分的Robot工具做进一步后续处理。Run `rebot --help` for more information.// 通过`rebot --help`命令获取更多帮助信息。Robot Framework is open source software released under Apache License 2.0. For more information about the framework and the rich ecosystem around itsee /.// RF是在Apache License 2.0下发布的开源软件,访问/获取更多关于框架的信息和丰富的生态系统。Options=======--rpa Turn on the generic automation mode. Mainly affects terminology so that "test" is replaced with "task" in logs and reports. By default the mode is got from test/task header in data files. New in RF 3.1.// 打开通用自动化模式。主要影响日志和报告中的术语,比如test会被task代替。默认情况可以从数据文件的test/task头获取模式信息。RF 3.1版本新增内容。-F --extension valueParse only files with this extension when executing a directory. Has no effect when running individual files or when using resource files. If more than one extension is needed, separate them with a colon.// 执行一个目录时只解析具有此扩展类型的文件。运行个人文件或使用资源文件时不受影响。如果需要多个文件类型,可通过冒号进行分隔。Examples: `--extension txt`, `--extension robot:txt`, Starting from RF 3.2 only `*.robot` files are parsed by default.// 示例:`--extension txt`,指定文件类型为txt格式; `--extension robot:txt`,指定文件类型为robot格式和txt格式。从RF 3.2版本开始默认解析robot格式文件。-N --name name Set the name of the top level suite. By default the name is created based on the executed file or directory.// 设置顶层套件名称。默认情况套件名称是基于执行文件或目录名创建的。-D --doc documentation Set the documentation of the top level suite. Simple formatting is supported (e.g. *bold*). If the documentation contains spaces, it must be quoted. If the value is path to an existing file, actual documentation is read from that file.// 设置顶层套件文档。支持简单格式化,如加粗。如果文档包含空格,则需要引用。如果值为一个现有文件的路径,则从该文件读取实际文档。Examples: --doc "Very *good* example", --doc doc_from_file.txt.// 示例:`--doc "Very *good* example"`,设置文档,Very *good* example,其中good加粗。`--doc doc_from_file.txt`,设置文件为指定路径指定文件。-M --metadata name:value * Set metadata of the top level suite. Value can contain formatting and be read from a file similarly as --doc. Example: --metadata Version:1.2// 设置顶层套件元数据。值可以包含格式并从文件读取,类似于--doc参数。示例:`--metadata Version:1.2`,指定顶层套件的版本信息Version:1.2。-G --settag tag * Sets given tag(s) to all executed tests.// 为所有执行测试设置给定的标签。-t --test name * Select tests by name or by long name containing also parent suite name like `Parent.Test`. Name is case and space insensitive and it can also be a simple pattern where `*` matches anything, `?` matches any single character, and `[chars]` matches one characterin brackets.// 通过名称或通过包含父套件的长名称(例如:Patent.Test)选择测试。名称不区分大小写和空格,可以是`*`匹配任何的简单模式,`?`匹配任何单个字符,`[chars]`匹配括号内的字符。--task name * Alias to --test. Especially applicable with --rpa.// --test的别名,特别适用于--rpa。-s --suite name * Select suites by name. When this option is used with --test, --include or --exclude, only tests in matching suites and also matching other filtering criteria are selected. Name can be a simple pattern similarly as with --test and it can contain parent name separated with a dot. For example, `-s X.Y` selects suite `Y` only if its parent is `X`.// 通过名称选择套件。当这个选项和--test、--include或--exclude一起使用,仅匹配套件和匹配其他过滤条件才会被选中进行测试。名称可以是和--test参数一样的简单模式,也可以是包含`.`分隔的名称。例如,`-s X.Y`,代表选择父级为X的套件Y。-i --include tag * Select tests 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.// 通过标签选择测试。近似于--test name,标签不区分大小写和空格,并且可以使用各种通配符,如`*`、`?`、`[]`。标签和模式可以是AND、OR、NOT等运算符的组合。Examples: --include foo, --include bar*, --include fooANDbar*.//示例:--include foo,包含标签为foo的测试;--include bar*,包含,标签中包含有bar的测试;--include fooANDbar*,包含标签为foo和标签中包含bar的测试。-e --exclude tag * Select test cases not to run by tag. These tests are not run even if included with --include. Tags are matched using same rules as with --include.// 通过标签选择不运行的测试用例。即使是同时使用--include参数这些测试也不会执行。标签的匹配规则和--include参数一致。-R --rerunfailed output Select failed tests from an earlier output file to be re-executed. Equivalent to selecting same tests individually using --test.// 从早期的output文件中选择失败的用例重新执行。等同于使用--test单独选择相同的测试。-S --rerunfailedsuites output Select failed suites from an earlier output file to be re-executed.// 从早期的output文件中选择失败的套件重新执行。--runemptysuite Executes suite even if it contains no tests. Useful e.g. with --include/--exclude when it is not an error that no test matches the condition.// 执行不包含测试用例的套件,即空套件。当使用--include/--exclude参数测试因为没有匹配到指定条件而引发错误时,忽略此错误,针对此场景,非常有用。--skip tag *Tests having given tag will be skipped. Tag can be a pattern. New in RF 4.0.// 指定标签的测试将会跳过。标签可以是一种模式。RF 4.0新增内容。--skiponfailure tag * Tests having given tag will be skipped if they fail. Tag can be a pattern. New in RF 4.0.// 如果指定标签执行失败将会跳过。标签可以是一种模式。RF 4.0新增内容。-n --noncritical tag * Alias for --skiponfailure. Deprecated since RF 4.0.// --skiponfailure的别名。RF 4.0已弃用。-c --critical tag *Opposite of --noncritical. Deprecated since RF 4.0.// --nocritical的对立面。RF 4.0已弃用。-v --variable name:value * Set variables in the test data. Only scalar variables with string value are supported and name is given without `${}`. See --variablefile for a more powerful variable setting mechanism.// 设置测试数据中的变量值。仅支持使用字符串值的纯变量,并且名称不是`${}`。更多有用的变量设置机制可参考--variablefile参数Examples:// 示例:--variable str:Hello => ${str} = `Hello`// 设置字符串变量名${str},值为Hello-v hi:Hi_World -E space:_ => ${hi} = `Hi World`// 设置字符串变量名为${hi},值为使用空格替换下划线的Hi World-v x: -v y:42 => ${x} = ``, ${y} = `42`// 设置变量${x},值为空,以及变量${y},值为42-V --variablefile path * Python or YAML file file to read variables from. Possible arguments to the variable file can be given after the path using colon or semicolon as separator.// 从Python或Yaml格式文件中读取变量。参数可以是使用冒号或分号分隔的变量文件和变量名。Examples: --variablefile path/vars.yaml, --variablefile environment.py:testing.// 示例:--variablefile path/vars.yaml,指定带有完整路径的变量文件;--variablefile environment.py:testing,指定变量为py文件中的testing。-d --outputdir dir Where to create output files. The default is the directory where tests are run from and the given path is considered relative to that unless it is absolute.// Output文件的输出位置。默认情况是和执行测试时的相同目录,给定的路径被认为是相对的,除非它是绝对的。-o --output file XML output file. Given path, similarly as paths given to --log, --report, --xunit, and --debugfile, is relative to --outputdir unless given as an absolute path. Other output files are created based on XML output files after the test execution and XML outputscan also be further processed with Rebot tool. Can be disabled by giving a special value `NONE`. Default: output.xml// XML格式的output文件。与--log、 --report、--xunit、--debugfile的给定路径类似。与--outputdir一样都是相对路径,除非是绝对路径。其他output文件是在测试执行和XML格式output输出后,基于XML格式output文件创建的,也可以使用Rebot工具做进一步处理。可以通过指定值为NONE来禁用此参数。默认为:output.xml-l --log file HTML log file. Can be disabled by giving a special value `NONE`. Default: log.html.// HTML格式log文件。可以通过指定值为NONE来禁用此参数。默认为:log.html。Examples: `--log mylog.html`, `-l NONE`.// 示例:`--log mylog.html`,设置日志文件为mylog.html;`-l NONE`,禁用log文件输出,不输出log文件。-r --report file HTML report file. Can be disabled with `NONE` similarly as --log. Default: report.html// HTML格式report文件。可以通过指定值为NONE来禁用此参数。默认为:report.html。-x --xunit filexUnit compatible result file. Not created unless this option is specified.// 兼容xUnit的结果文件。除非选项指定否则不会生成。--xunitskipnoncritical Deprecated since RF 4.0 and has no effect anymore.// RF 4.0开始已弃用,无影响。-b --debugfile fileDebug file written during execution. Not created unless this option is specified.// 执行过程中写debug文件。除非选项指定否则不会debug文件不会被创建。-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-0503-154410.xml` and`report-0503-154410.html`.// 当使用此选项时,会在所有输出文件的文件名和文件类型扩展之间增加一个格式化的时间戳(YYYYMMDD-hhmmss)。例如:`-T -o output.xml -r report.html -l none`代表输出物report和output两个文件,会增加时间戳显示,最终输出物为:output-0503-154410.xml、report-0503-154410.html--splitlog Split the log file into smaller pieces that open in browsers transparently.// 将日志文件分隔为更小的部分,便于在浏览器中展示。--logtitle titleTitle for the generated log file. The default title is `<SuiteName> Test Log`.// 设置生成日志文件的抬头。默认以套件名作为日志文件的Title名。--reporttitle title Title for the generated report file. The default title is `<SuiteName> Test Report`.// 设置生成报告文件的抬头。默认以套件名作为报告文件的Title名。--reportbackground colors Background colors to use in the report file. Order is `passed:failed:skipped`. Both color names and codes work. `skipped` can be omitted.// 设置报告文件使用的背景颜色。顺序是:`passed:failed:skipped`,颜色名称或颜色代码都可以生效。`skipped`可以省略。Examples: --reportbackground green:red:yellow, --reportbackground #00E:#E00.// 示例:--reportbackground green:red:yellow,指定背景颜色分别为 绿色、红色、黄色。另外一个示例,自己查颜色代码吧。--maxerrorlines lines Maximum number of error message lines to show in report when tests fail. Default is 40, minimum is 10 and `NONE` can be used to show the full message.// 当测试失败时在报告中展示的错误消息行数最大值。默认是40,最小是10,如果是NONE则代表展示全部消息。-L --loglevel levelThreshold level for logging. Available levels: TRACE, DEBUG, INFO (default), WARN, NONE (no logging). Use syntax `LOGLEVEL:DEFAULT` to define the default visible log level in log files.// 日志级别的临界点。可用日志级别包括:TRACE、DEBUG、INFO(默认值)、WARN、NONE(不记录日志)。使用语法为:`LOGLEVEL:DEFAULT`定义了日志文件中默认的可见日志级别。Examples: --loglevel DEBUG, --loglevel DEBUG:INFO.// 示例:--loglevel DEBUG,日志级别为DEBUG;--loglevel DEBUG:INFO,日志级别为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// 在日志和报告中展示多少层级的套件统计数据。默认展示全部层级的套件。示例:`--suitestatlevel 3`,展示3层套件层级。--tagstatinclude tag * Include only matching tags in `Statistics by Tag` in log and report. By default all tags are shown. Given tag can be a pattern like with --include.// 在日志和报告中只展示匹配标签的标签统计数据。默认展示全部标签数据。指定标签可以通过参数`--include`来指定。--tagstatexclude tag * Exclude matching tags from `Statistics by Tag`. This option can be used with --tagstatinclude similarly as --exclude is used with --include.// 在日志和报告中排除展示匹配标签的标签统计数据。此选项可以和--tagstatinclude一起使用,效果与--exclude与--include一起使用时一样。--tagstatcombine tags:name * Create combined statistics based on tags. These statistics are added into `Statistics by Tag`. If the optional `name` is not given, name of the combined tag is got from the specified tags. Tags arematched using the same rules as with --include.// 创建基于标签的结合统计数据。这些统计数据会被增加到标签统计数据中。如果选项中的`name`没有指定,则从指定的标签中获取组合标签的名称。标签匹配规则与--include规则一致。Examples: --tagstatcombine requirement-*, --tagstatcombine tag1ANDtag2:My_name.// 示例:--tagstatcombine requirement-*,组合标签,匹配所有包含requirement-标签的测试。--tagstatcombine tag1ANDtag2:My_name,组合标签,匹配tag1和tag2,包含My_name标签。--tagdoc pattern:doc * Add documentation to tags matching the given pattern. Documentation is shown in `Test Details` and also as a tooltip in `Statistics by Tag`. Pattern can use `*`, `?` and `[]` as wildcards like --test. Documentation can contain formatting like --doc.// 向匹配给定模式的标签中增加文档。文档会展示在`Test Details`中,并且在标签统计数据中有工具提示。与--test参数一致可以使用各种通配符,如`*`、`?`、`[]`。文档可以像--doc参数一样包含格式。Examples: --tagdoc mytag:Example, --tagdoc "owner-*:Original author".// 示例:--tagdoc mytag:Example,对匹配Example标签增加文档。--tagdoc "owner-*:Original author",对包含owner-*的增加Original author内容。--tagstatlink pattern:link:title * Add external links into `Statistics by Tag`. Pattern can use `*`, `?` and `[]` as wildcards like --test. Characters matching to `*` and `?` wildcards can be used in link and title with syntax %N, where N is index of the match (starting from 1).// 向标签统计数据中增加额外链接。与--test参数一致可以使用各种通配符,如`*`、`?`、`[]`。`*`和`?`这种通配符匹配可以使用语法`%N`用于链接和标题,N代表匹配的索引(从1开始)。Examples: --tagstatlink mytag:http://my.domain:Title, --tagstatlink "bug-*:http://url/id=%1:Issue Tracker".// 示例:`--tagstatlink mytag:http://my.domain:Title`,向匹配mytag标签增加标题为Title的链接;`--tagstatlink "bug-*:http://url/id=%1:Issue Tracker"`,向包含bug-的标签,增加标题为Issue Tracker的链接。--expandkeywords name:<pattern>|tag:<pattern> *Matching keywords will be automatically expanded in the log file. Matching against keyword name or tags work using same rules as with --removekeywords.// 在日志文件中扩展匹配关键字。使用与 --removekeywords相同的规则来匹配关键字名称或标签。Examples: --expandkeywords name:BuiltIn.Log, --expandkeywords tag:expand. New in RF 3.2.// 示例:`--expandkeywords name:BuiltIn.Log`,通过名称来扩展关键字;`--expandkeywords tag:expand`,通过标签来扩展关键字,RF 3.2版本新增内容。--removekeywords all|passed|for|wuks|name:<pattern>|tag:<pattern> *Remove keyword data from the generated log file. Keywords containing warnings are not removed except in the `all` mode.// 从生成的日志文件中移除关键字数据。包含警告信息的关键字不会被移除,除非指定了all模式。all:remove data from all keywords// all:移除全部关键字。passed: remove data only from keywords in passed test cases and suites// passed:移除测试用例和套件中测试通过的关键字数据。for:remove passed iterations from for loops// for:从for循环中删除通过的。wuks: remove all but the last failing keyword inside `BuiltIn.Wait Until Keyword Succeeds`// wuks:移除除了在`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 `[]` wildcards.// name:模式:移除匹配给定模式全部关键字数据。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 patterns can contain `*`, `?` and `[]` wildcards. Tags and patterns can also be combined together with `AND`, `OR`, and `NOT` operators.// tag:模式:移除匹配给定标签的全部关键字数据。Examples: --removekeywords foo, --removekeywords fooANDbar*.// 示例:通过标签foo来移除,通过标签foo和包含bar匹配的来移除。--flattenkeywords for|foritem|name:<pattern>|tag:<pattern> *Flattens matching keywords in the generated log file. Matching keywords get all log messages from their child keywords and children are discarded otherwise.// 展平生成的日志文件中的匹配关键字。 匹配关键字从其子关键字获取所有日志消息,否则将丢弃子关键字。for:flatten for loops fully// for:完全展平for循环。foritem: flatten individual for loop iterations// foritem:展平个别的for循环迭代。name:<pattern>: flatten matched keywords using same matching rules as with `--removekeywords name:<pattern>`// name:模式:通过名称来匹配展平。tag:<pattern>: flatten matched keywords using same matching rules as with `--removekeywords tag:<pattern>`// tag:模式:通过标签来匹配展平。--listener class * A class for monitoring test execution. Gets notifications e.g. when tests start and end. Arguments to the listener class can be given after the name using a colon or a semicolon as a separator.// 监控测试执行的类。获得通知,例如,当测试开始或结束时。监听器类的参数可以在名称之后使用冒号或分号作为分隔符给出。Examples: --listener MyListenerClass, --listener path/to/Listener.py:arg1:arg2.// 示例:监听器MyListenerClass,通过具体路径和py文件以及参数,指定监听器。--nostatusrcSets the return code to zero regardless of failures in test cases. Error codes are returned normally.// 无论测试用例是否失败,都将返回码设置为零。 错误代码正常返回。--dryrun Verifies test data and runs tests so that library keywords are not executed.// 确认测试数据和运行测试时哪些库关键字不执行。-X --exitonfailure Stops test execution if any critical test fails.// 如果发生了严重的测试失败则停止执行测试。--exitonerror Stops test execution if any error occurs when parsing test data, importing libraries, and so on.// 在解析测试数据、导入库或其他操作时,如果发生任何错误,则停止测试执行。--skipteardownonexit Causes teardowns to be skipped if test execution is stopped prematurely.// 如果过早停止测试执行,则teardowns会被跳过执行。--randomize all|suites|tests|none Randomizes the test execution order.// 随机化测试执行顺序。all: randomizes both suites and tests// all:包括测试套件和测试用例全部随机化。suites: randomizes suites// suites:仅随机化测试套件。tests: randomizes tests// tests:仅随机化测试用例。none: no randomization (default)// none:默认不开启随机化。Use syntax `VALUE:SEED` to give a custom random seed. The seed must be an integer.// 使用语法:`VALUE:SEED`来指定一个自定义随机值。随机值必须是一个整数。Examples: --randomize all, --randomize tests:1234.// 示例:`--randomize all`,测试套件和用例全部随机。--prerunmodifier class * Class to programmatically modify the test suite structure before execution.// 在执行前通过编程方式修改测试套件结构类。--prerebotmodifier class * Class to programmatically modify the result model before creating reports and logs.// 在生成报告和日志文件前通过编程方式修改结果模型类。--console type How to report execution on the console.// 如何在控制台报告执行情况。verbose: report every suite and test (default)// verbose:冗余,默认值,报告每个测试套件和测试用例。dotted: only show `.` for passed test, `f` for failed non-critical tests, and `F` for failed critical tests// dotted:`.`只展示测试通过用例。`f`只展示测试失败不严重的用例。`F`测试失败且严重的用例。quiet: no output except for errors and warnings// quiet:除了错误和警告其他不输出。none:no output whatsoever// none:任何情况都不输出。-. --dotted Shortcut for `--console dotted`.// `--console dotted`的简写。--quietShortcut for `--console quiet`.// `--console quiet`的简写。-W --consolewidth chars Width of the console output. Default is 78.// 控制台输出的宽度,默认值为78。-C --consolecolors auto|on|ansi|off Use colors on console output or not.// 在控制台输出使用颜色或不使用。auto: use colors when output not redirected (default)// auto:默认,输出未重定向时使用颜色。on: always use colors// on:总是使用颜色。ansi: like `on` but use ANSI colors also on Windows// ansi:和on类似,但是在Windows环境使用ANSI颜色。off: disable colors altogether// off:完全禁用颜色。Note that colors do not work with Jython on Windows.// 注意,在Windows的Jython环境,颜色不能生效。-K --consolemarkers auto|on|off Show markers on the console when top level keywords in a test case end. Values have same semantics as with --consolecolors.// 在一个测试用例中的顶级关键字结束时在控制台展示标记。值与--consolecolors具有相同语义。-P --pythonpath path * Additional locations (directories, ZIPs, JARs) where to search test libraries and other extensions when they are imported. Multiple paths can be given by separating them with a colon (`:`) or by using this option several times. Given path can also be a glob pattern matching multiple paths.// 当测试库或其他扩展需要被导入时增加的搜寻的额外路径(目录、压缩包、Jar包)。使用冒号来分隔多个路径或多次使用,给定路径也可以是匹配多个路径的全局模式。Examples: --pythonpath libs/ --pythonpath resources/*.jar, --pythonpath /opt/testlibs:mylibs.zip:yourlibs.// 示例:`--pythonpath libs/`,设置python库路径为libs。`--pythonpath resources/*.jar`,设置加载的jar包资源。`--pythonpath /opt/testlibs:mylibs.zip:yourlibs`,设置多个资源路径。-A --argumentfile path * Text file to read more arguments from. Use special path `STDIN` to read contents from the standard input stream. File can have both options and input files or directories, 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.// 指定读取更多参数的文件。使用特殊路径“STDIN”从标准输入流中读取内容。 文件可以有选项和输入文件或目录,每行一个。 内容不需要转义,但会删除行首和行尾的空格。 空行和以井号 (#) 开头的行将被忽略。Example file:// 示例文件:| --include regression // 包含哪些测试用例| --name Regression Tests// 指定测试用例范围| # This is a comment line// 注释,忽略| my_tests.robot// 测试套件名称| path/to/test/directory/// 路径Examples:// 示例:--argumentfile argfile.txt --argumentfile STDIN// 指定参数文件,指定标准输入。-h -? --help Print usage instructions.// 展示帮助文档。--versionPrint version information.// 展示版本信息。Options that are marked with an asterisk (*) can be specified multiple times. For example, `--test first --test third` selects test cases with name `first` and `third`. If an option accepts a value but is not marked with an asterisk, the last given value has precedence. For example, `--log A.html --log B.html` creates log file `B.html`. Options accepting no values can be disabled by using the same option again with `no` prefix added or dropped. The last optionhas precedence regardless of how many times options are used. For example, `--dryrun --dryrun --nodryrun --nostatusrc --statusrc` would not activate the dry-run mode and would return a normal return code.// 标记为*的选项可以重复配置多次。例如,`--test first --test third`代表选择名为first和third的测试用例名称。如果一个选项接受一个值但没有被标记为*,最后指定的值会被优先使用。例如:`--log A.html --log B.html`代表创建一个名为B.html的日子文件。选项接受无参可以通过再次使用相同名称的选项或前缀增加no来禁用。最后一个选项无论使用多少次,都具有优先权,例如:`--dryrun --dryrun --nodryrun --nostatusrc --statusrc`代表不会受dry-run模式的影响并且返回正常返回码。Long option format is case-insensitive. For example, --SuiteStatLevel is equivalent to but easier to read than --suitestatlevel. Long options can also be shortened as long as they are unique. For example, `--logti Title` works while `--lo log.html` does not because the former matches only --logtitle but the latter matches --log, --loglevel and --logtitle.// 长选项格式不区分大小写。例如:--SuiteStatLevel相比--suitestatlevel是一样的,只是更易读。长选项也可以简写为唯一格式,例如:`--logti Title`可以工作但`--lo log.html` 不可以工作,这是因为`--logti`等于`--logtitle`,但是`--log`能匹配的太多了,包括--log, --loglevel and --logtitle,无法匹配到底对应哪个。Environment Variables=====================// 环境变量ROBOT_OPTIONS Space separated list of default options to be placed in front of any explicit options on the command line.// 空格分隔默认选项,空格位于命令行选项前。ROBOT_SYSLOG_FILE Path to a file where Robot Framework writes internal information about parsing test case files and running tests. Can be useful when debugging problems. If not set, or set to a special value `NONE`, writing to the syslog file is disabled.// 指定一个文件路径用于RF写关于解析测试用例文件和运行测试时的内部信息。调试问题时使用。如果不设置,或指定值为NONE,会禁用写系统日志文件。ROBOT_SYSLOG_LEVEL Log level to use when writing to the syslog file. Available levels are the same as with --loglevel command line option and the default is INFO.// 设置写系统日志文件的日志级别。可用的级别范围与--loglevel命令行选项一致,默认为INFO级别。ROBOT_INTERNAL_TRACESWhen set to any non-empty value, Robot Framework's internal methods are included in error tracebacks.// 当设置任何不为空的值,RF内部方法会包含在错误回溯中。Examples========// 示例# Simple test run using `robot` command without options.// 简单示例,通过robot命令不带任何参数,运行测试。$ robot tests.robot# Using options.// 使用选项,包含smoke冒烟测试标签,测试用例名称为Smoke Tests,路径为path/to/tests.robot。$ robot --include smoke --name "Smoke Tests" path/to/tests.robot# Executing `robot` module using Python.// 使用python启动robot模块。$ python -m robot path/to/tests# Running `robot` directory with Jython.// 使用Jython启动robot测试。$ jython /opt/robot tests.robot# Executing multiple test case files and using case-insensitive long options.// 使用不区分大小写的长选项执行多个测试用例文件。$ robot --SuiteStatLevel 2 --Metadata Version:3 tests/*.robot more/tests.robot# Setting default options and syslog file before running tests.// 在运行测试前设置默认选项和日志文件。$ export ROBOT_OPTIONS="--outputdir results --suitestatlevel 2"$ export ROBOT_SYSLOG_FILE=/tmp/syslog.txt$ robot tests.robot