2

I would like to know , how to group set of repeated statements in Specflow scenarios. for example.

Given I launch xyz login page
And I enter username as ABC and password as ***** and click login
And i click on Benefits tile
And i click on Xyz section

Is there a way to group these statements instead of using this again and again.

Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331

2 Answers2

2

Yes. you can create a step which calls the other steps. The documentation for this is here. There is an example of this in this answer

Community
  • 1
  • 1
Sam Holder
  • 32,535
  • 13
  • 101
  • 181
0

I have used the Background tag this will execute the methods before each scenario

Background:
Given I launch xyz login page
And I enter username as ABC and password as ***** and click login
And i click on Benefits tile
And i click on Xyz section
hiram acebo
  • 119
  • 1
  • 9