# How to prevent from browser closing in test suite

**URL:** <https://forum.katalon.com/t/how-to-prevent-from-browser-closing-in-test-suite/6462>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [June 9, 2017, 7:17am UTC](https://forum.katalon.com/t/how-to-prevent-from-browser-closing-in-test-suite/6462 "2017-06-09T07:17:17Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Ng\_Sek\_Long](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/ng_sek_long/32/16104_2.png) [@Ng\_Sek\_Long](https://forum.katalon.com/u/Ng_Sek_Long)\
**Post date:** [July 26, 2020, 10:56am UTC](https://forum.katalon.com/t/how-to-prevent-from-browser-closing-in-test-suite/6462/7 "2020-07-26T10:56:52Z")

</div>

My use case is: 5 test cases. All need to execute in separate Chrome browser. All need to not close after the script is finished, because last screen need human review.

My solution is as follows:

1. Prevent Test suite close browser (Project -\> Settings -\> Execution -\> Terminate driver after each test suite)  
_Credit: Zazrshima above_
2. Add a new Test Listener

```java
    import com.kms.katalon.core.webui.driver.DriverFactory
    import org.openqa.selenium.WebDriver
    import org.openqa.selenium.chrome.ChromeDriver

    class NewTestListener {

      @BeforeTestCase
      def sampleBeforeTestCase(TestCaseContext testCaseContext) {
        // Remember to replace your own Chrome Driver location
        System.setProperty("webdriver.chrome.driver", "C:\\SomeWhereInYourDrive\\Katalon_Studio_Windows_64\\configuration\\resources\\drivers\\chromedriver_win32\\chromedriver.exe")

        WebDriver driver1 = new ChromeDriver()
        DriverFactory.changeWebDriver(driver1)
      }
    }

```

_Credit: [Automate two different sites as part of the same test](http://forum.katalon.com/t/automate-two-different-sites-as-part-of-the-same-test/12352/7)_

1. Remove all the `WebUI.openBrowser('')` from all your scripts.

2. Add your test cases to the same test suit and execute

3. You should see your test case being executed in different Chrome browser

See if this is useful to anybody, thanks.

---

_[View the full topic](https://forum.katalon.com/t/how-to-prevent-from-browser-closing-in-test-suite/6462)._
