Want to execute Background only once in Cucumber feature files for multiple scenarios

SaeeK picture SaeeK · Jan 12, 2016 · Viewed 15k times · Source

I Want to execute Background only once in each cucumber feature files for multiple scenarios. how can i do that in step files?

Feature: User can verify...........

Background: Given Enter test data for a specific logic

Scenario: Verify ......... 1 When A1 And B1 Then C1

Scenario: Verify ......... 2 When A2 And B2 Then C2

Scenario: Verify ......... 2 When A3 And B3 Then C3

Answer

ASM picture ASM · Feb 18, 2016

Background is designed to run each time before each scenario. Its not good and standard as well to hack Background.