-1

I want to have restarted my BrowserDriver for each serenity scenario runs. So every time new Driver will open for each scenario and closes the previous. But it never happens. In my framework, the browser keeps open and i don't want that. Here is my jar Versions i am using in POM.

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <serenity.version>1.1.36</serenity.version>
    <serenity.maven.version>1.1.36</serenity.maven.version>
    <serenity.cucumber.version>1.1.8</serenity.cucumber.version>
</properties>

I am providing the versions, As this issue might be related with these versions.

Here is the serenity.properties file as well.

serenity.project.name=*****Sample Automation Project*****
Webdriver.driver=chrome
serenity.dry.run=false
serenity.logging=QUIET

I have tried using this below property too:

serenity.restart.browser.for.each=scenario
ASM
  • 709
  • 2
  • 8
  • 27
  • Just make sure that you set this parameter correctly as it should look like this: `serenity.restart.browser.for.each=scenario` – Eugene S Dec 06 '17 at 02:24
  • Thanks. I have resolved it by updating the jar versions. It was issue with the jar versions. – ASM Dec 06 '17 at 02:38
  • And you left this parameter as is -> `serenity.restart.browser.each.scenario`? If it works like this this means that some other configuration is being used. – Eugene S Dec 06 '17 at 02:39

1 Answers1

0

I have resolved this problem and it was issue with Serenity jars. I have updated jars to use the latest and it resolved my issue. Now Serenity can re-instantiate the driver for each scenario.

    <serenity.version>1.8.1</serenity.version>
    <serenity.maven.version>1.8.0</serenity.maven.version>
    <serenity.cucumber.version>1.6.5</serenity.cucumber.version>
ASM
  • 709
  • 2
  • 8
  • 27
  • I am also trying `serenity.restart.browser.for.each=feature` but it doesn't work. Is it working for you in 2020? What version of the jars you are using? – paul Sep 22 '20 at 20:20