【问题标题】:How to pass the examples from excel file for scenario outline如何将 excel 文件中的示例传递给场景大纲
【发布时间】:2020-01-22 15:25:46
【问题描述】:

在 BDD specflow 中,我们具有从 excel 传递场景大纲示例的功能,如下所示

Feature: ExcelTestFeature
        test transform of excel data into dictionary

Scenario Outline: Multiline Data
                  Given data converts to "<one>", "<two>" dictionary

 @source:Testdata.xlsx:Sheet1
 Examples:
 |ono|two|

我们在黄瓜 bdd 中是否有 @source:Testdata.xlsx:Sheet1 的等效代码?

注意:我需要在 qmetry 自动化框架中解决 cucumber 中的问题

【问题讨论】:

  • 我认为黄瓜中没有等价物。 Cucumber 建议使用数据表或示例表将数据构建到特征文件中。但是可以使用外部数据表作为数据表。

标签: cucumber


【解决方案1】:

如果你使用 cucumber with java,你可以添加 qaf-cucumber 依赖。然后您可以将数据提供者元数据添加到您的场景中,如下例所示:

@dataFile:Testdata.xlsx @sheetName:Sheet1
Scenario Outline: Multiline Data
      Given data converts to "<one>", "<two>" dictionary

【讨论】:

    猜你喜欢
    • 2021-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-28
    相关资源
    最近更新 更多