-
Katalon Studio supports the SetUp and Teardown methods, which are groups of your own defined test steps before or after executing a Test Suite. This feature is another useful extension besides Test Listeners to extend your current testing flow as much as possible.
Enable SetUp and TearDown
-
You need to set skipped value from true to false to activate related methods.
Example
-
I create a Test Suite which has 2 Test Cases: TC1_Verify Successful Login, TC2_Verify Successful Appointment. Each of them has steps WebUI.openBrowser and WebUI.closeBrowser
-
To avoid repeat these steps when executing a Test Suite, I simply change
from
skipped = true
intoskipped = false
. Also, I input scripts openBrowser, closeBrowser for @Setup and @Teardown. The scenario will be like this:
-
Open browser
-
Execute TC1
-
Execute TC2
-
Close browser
-
@SetupTestCase and @TearDownTestCase have a similar way with @Setup and @TearDown to enable them, just changing from
skipped = true
intoskipped = false
. But this feature will apply for each of Test Case in a Test Suite -
I simply println() sentences to demonstrate the behaviour as below:
TC1:
TC2:

The following workflow can be used to better visualize how Katalon Studio execute test automation projects with/ without setUp and tearDown methods.
Please also refer to this document and videos:
- Test Fixtures and Test Listeners (Test Hooks)
- Setup/ Teardown Test Suite
- Improve a automation basic test case: Setup & Teardo
Comments
0 comments
Please sign in to leave a comment.