找不到与此步骤异常匹配的步骤绑定

时间:2018-07-05 10:15:43

标签: specflow

我创建了一个非常简单的功能文件。通过按 F12 转到定义时。我收到错误

  

找不到与此步骤匹配的步骤绑定。

它被扔到我的When步骤。

Feature: ItemBag



Scenario Outline: Add item to bag until 200 is reached
Given I navigate to the homepage
And I search for trainers
When I add to the bag
Then trainers are added till 200 is reached 

1 个答案:

答案 0 :(得分:0)

您需要创建一个Step文件。应该是这样的:

public class Steps
{
  [Binding]
  public void InavigateToTheHomepage()
  {
    this step implementation;
  }

  public void nextStep()
  {
    this step implementation;
  }
}

此类应包含您所有步骤的实现。之后,您就不会收到此类错误。

相关问题