New browser instance is opened for each scenario in a cucumber feature file

Whenever i run the feature file, each browser instance is opened for each scenario. I expect to run all my scenarios of a feature file in a single browser instance. PS: I have not defined the driver inside method annotated with Before hook

Am using java as programming language

Default Asked on January 12, 2018 in Selenium WebDriver.
Add Comment
  • 2 Answer(s)

    same issue here – can someone help

    Default Answered on March 1, 2018.
    Add Comment

    well i changed the variable driver to Static under class WebDriverManager and it worked

    so private static WebDriver driver instead of private WebDriver driver

     

    Default Answered on March 1, 2018.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.