RobotFramework测试框架(6)测试用例文件结构

Setting section

The Setting section is used to import libraries, resource files and variable files and to define metadata for test suites and test cases. It can be included in test case files and resource files. Note that in a resource file, a Setting section can only include settings for importing libraries, resources, and variables.

Settings available in the Setting section
Name Description
Library Used for importing libraries.
Resource Used for taking resource files into use.
Variables Used for taking variable files into use.
Name Used for setting a custom suite name.
Documentation Used for specifying a suite or resource file documentation.
Metadata Used for setting free suite metadata.
Suite Setup Used for specifying the suite setup.
Suite Teardown Used for specifying the suite teardown.
Test Tags Used for specifying test case tags for all tests in a suite.
Force Tags, Default Tags Deprecated settings for specifying test case tags.
Keyword Tags Used for specifying user keyword tags for all keywords in a certain file.
Test Setup Used for specifying a default test setup.
Test Teardown Used for specifying a default test teardown.
Test Template Used for specifying a default template keyword for test cases.
Test Timeout Used for specifying a default test case timeout.
Task Setup, Task Teardown, Task Template, Task Timeout Aliases for Test Setup, Test Teardown, Test Template and Test Timeout, respectively, th
*** Settings ***
Documentation
Metadata

Library    BuiltIn
Library    3rd Party
Library    Custom
Resource
Variables

Suite Setup
Suite Teardown
Test Setup
Test Teardown
Test Template
Test Timeout

Test Tags

Variables

*** Variables ***
${VARIABLE}  This is a Variable
${COMPOSITE VARIABLES}  ${VARIABLE} with other variables.

Test Case section

The settings in the Test Case section are always specific to the test case for which they are defined. Some of these settings override the default values defined in the Settings section.

Exactly same settings are available when creating tasks in the Task section.

Settings available in the Test Case section
Name Description
[Documentation] Used for specifying a test case documentation.
[Tags] Used for tagging test cases.
[Setup] Used for specifying a test setup.
[Teardown] Used for specifying a test teardown.
[Template] Used for specifying a template keyword.
[Timeout] Used for specifying a test case timeout.
Test Case
    [Documentation]
    [Tags]
    [Timeout]
    [Setup]
    [Template]
    Static Variable Assignments
    Keyword Calls
    Verification Keyword Call
    [Teardown]

 

Keyword section

Settings in the Keyword section are specific to the user keyword for which they are defined.

Settings available in the Keyword section
Name Description
[Documentation] Used for specifying a user keyword documentation.
[Tags] Used for specifying user keyword tags.
[Arguments] Used for specifying user keyword arguments.
[Setup] Used for specifying a user keyword setup. New in Robot Framework 7.0.
[Teardown] Used for specifying user keyword teardown.
[Timeout] Used for specifying a user keyword timeout.
[Return] Used for specifying user keyword return values. Deprecated in Robot Framework 7.0. Use the RETURN statement instead.
Keyword
    [Documentation]
    [Tags]
    [Arguments]
    [Timeout]
    [Setup]
    Static Variable Assignments
    Keyword Calls
    [Teardown]

相关推荐

  1. RobotFramework测试框架6测试文件结构

    2024-04-07 05:40:02       30 阅读
  2. RobotFramework测试框架(11)--变量文件

    2024-04-07 05:40:02       16 阅读
  3. RobotFramework测试框架(7)-SeleniumLibrary常关键字

    2024-04-07 05:40:02       10 阅读
  4. unittest框架管理测试

    2024-04-07 05:40:02       32 阅读
  5. pytest框架测试实现输出log到指定文件

    2024-04-07 05:40:02       38 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-07 05:40:02       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-07 05:40:02       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-07 05:40:02       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-07 05:40:02       18 阅读

热门阅读

  1. 面对对象编程(四)

    2024-04-07 05:40:02       17 阅读
  2. leetcode 169.多数元素

    2024-04-07 05:40:02       45 阅读
  3. ROC与决策树介绍

    2024-04-07 05:40:02       22 阅读
  4. 在 HTML 中禁用 Chrome 浏览器的 Google 翻译功能

    2024-04-07 05:40:02       36 阅读
  5. MongoDB的简单使用

    2024-04-07 05:40:02       20 阅读
  6. leetcode 72.编辑距离

    2024-04-07 05:40:02       22 阅读
  7. 深入了解go的通道类型

    2024-04-07 05:40:02       16 阅读
  8. 外刊杂志经济学人获取方式

    2024-04-07 05:40:02       18 阅读
  9. golang mutex

    2024-04-07 05:40:02       18 阅读
  10. 【Rust】基础语法

    2024-04-07 05:40:02       20 阅读
  11. 设计模式:外观模式

    2024-04-07 05:40:02       17 阅读
  12. 机器学习软件perming的使用文档

    2024-04-07 05:40:02       14 阅读
  13. AJAX

    AJAX

    2024-04-07 05:40:02      14 阅读
  14. 设计模式:策略模式

    2024-04-07 05:40:02       37 阅读
  15. Spring和Spring Boot的区别

    2024-04-07 05:40:02       20 阅读