如何从黄瓜中的 excel 中读取数据

How to read data from excel in cucumber

我必须阅读 excel 其中 excel 有员工姓名、流程、开始日期、结束日期和员工 ID columns.In excel,对于每个员工流程是不同,(过程我必须从 UI 的下拉列表中 select),开始日期,结束 date.I 必须从 excel 中获取所有这些详细信息,我必须捕获员工 ID在创建员工并放回 excel.How 之后,我要使用黄瓜吗?

您可以使用 Cucumber 表,不需要使用 excel 个文件。

要阅读 excel 个文件,您需要创建一个广泛的 excel 阅读 class。

为什么使用 Excel 是一种反模式?点击 here

您可以使用场景大纲,例如:

Feature: Calculator
  As a user
  I want to use a calculator to add numbers
  So that I don't need to add myself

  Scenario Outline: Add two numbers <num1> & <num2>
    Given I have a calculator
    When I add <num1> and <num2>
    Then the result should be <total>

  Examples: 
    | num1 | num2 | total |
    | -2 | 3 | 1 |
    | 10 | 15 | 25 |
    | 99 | -99 | 0 |
    | -1 | -10 | -11 |