wttech/bobcat

Webdriver browser instance remains open even after running all the tests while using webdriver.reusable property as true

GuptaMegha opened this issue · 1 comments

Environment

Bobcat version:

Bobcat modules used:

  • bb-core
  • bb-aem-65
  • bb-junit5

Browser Chrome 81 version:

Expected Behavior

When webdriver.reusable = true
then Webbrowser should be closed afterAll the tests are ran.

Actual Behavior

Even after all the test are ran, a blank instance remain open.

Steps to reproduce

I need to reuse the AEM pages so I am creating pages in BeforeAll instead of BeforeEach and then creating separate tests for these pages and at the end I am deleting all the pages in AfterAll.

So I have to use webdriver.reusable property otherwise webdriver is getting closed after each test.

On using the property tests are running fine but at the end of the test webdriver browser instance remains open as Blank page.

Hello @GuptaMegha,

afaik, this is expected behavior with BobCat. I just can't find that snippet of documentation in the latest release.
However, please consider using WebDriverRegistry in order to close open webdriver instances.

If that is not working for you, I would recommend using the scenariocontext-pattern (https://github.com/Cognifide/bobcat/wiki/ScenarioContext), where you could store page information and using an after-hook to delete that pages.

Best,
Arno