【问题标题】:How to use Test Setup (ROBOTFRAMEWORK) in another tests cases?如何在其他测试用例中使用测试设置(ROBOTFRAMEWORK)?
【发布时间】:2021-11-07 05:16:45
【问题描述】:

我需要选择一个数据库信息来填充我的测试用例中的一些输入文本。

我收到错误 Setting 'Test Setup' is not allowed in suite 初始化文件。

*** Settings ***

Resource  ${ROOT}/path/main.resource

Test Setup          Test setup from __init__.robot
#
*** Keywords ***

access some menu 

【问题讨论】:

    标签: robotframework


    【解决方案1】:

    __init__.robot 中您应该更改为:

    Suite Setup
    

    那么你不要在每个测试中调用它。

    【讨论】:

    • 非常感谢!
    【解决方案2】:

    这是您可以使用的__init__.robot 示例

    *** Settings ***
    Library    Screenshot
    
    Suite Setup         TAKE SCREENSHOT
    

    这将为您的测试套件中的每个测试自动执行

    【讨论】:

      猜你喜欢
      • 2019-02-22
      • 2022-11-27
      • 1970-01-01
      • 1970-01-01
      • 2019-09-14
      • 2019-03-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多