From fa4234b2bf9242ce2e7c4bfd21d5edea19970cb9 Mon Sep 17 00:00:00 2001 From: huynguyen2908 Date: Thu, 28 Oct 2021 14:28:25 +0700 Subject: [PATCH] Fix connection refused occasionally --- Test Listeners/TestListener.groovy | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Test Listeners/TestListener.groovy b/Test Listeners/TestListener.groovy index 4705359..db5d817 100644 --- a/Test Listeners/TestListener.groovy +++ b/Test Listeners/TestListener.groovy @@ -1,6 +1,9 @@ import com.katalon.KatalonHelper +import com.kms.katalon.core.annotation.AfterTestCase import com.kms.katalon.core.annotation.BeforeTestSuite +import com.kms.katalon.core.context.TestCaseContext import com.kms.katalon.core.context.TestSuiteContext +import com.kms.katalon.core.webui.util.WebDriverCleanerUtil class TestListener { /** @@ -11,4 +14,9 @@ class TestListener { def sampleBeforeTestSuite(TestSuiteContext testSuiteContext) { KatalonHelper.updateInfo() } + + @AfterTestCase + def terminateRunningWebDrivers(TestCaseContext testCaseContext) { + WebDriverCleanerUtil.cleanup() + } } \ No newline at end of file