Reputation: 157
I have written few scenarios in one cucumber feature file and its execute with Selenium web driver.
Cucumber feature
Scenario 1 Scenario 2 Scenario 3
When ever I execute the tests it openup new browser session and close it at the end. I would like to run the 3 tests in same browser session.
How can i achieve this?
Upvotes: 1
Views: 5969
Reputation: 1006
Using the JUnit Annotations below in your Test Runner not Test Hook.
@BeforeClass
public static void setUp(){
openABrowser();
}
@AfterClass
public static void tearDown(){
closeABrowser();
}
Upvotes: 2