I do not understad your question. I believe that Katalon Studio is able to call 2 or more TestListeners.
Let me show you an example.
I made “Test Listeners/TestListener2” and “Test Listeners/TestListener3” as follows
import com.kms.katalon.core.annotation.AfterTestSuite
import com.kms.katalon.core.annotation.BeforeTestSuite
import com.kms.katalon.core.context.TestSuiteContext
class TestListener2 {
@BeforeTestSuite
def sampleBeforeTestSuite(TestSuiteContext testSuiteContext) {
println "TestListener2 started"
}
@AfterTestSuite
def sampleAfterTestSuite(TestSuiteContext testSuiteContext) {
println "TestListener2 ran and finished"
}
}
import com.kms.katalon.core.annotation.AfterTestSuite
import com.kms.katalon.core.annotation.BeforeTestSuite
import com.kms.katalon.core.context.TestSuiteContext
class TestListener3 {
@BeforeTestSuite
def sampleBeforeTestSuite(TestSuiteContext testSuiteContext) {
println "TestListener3 started"
}
@AfterTestSuite
def sampleAfterTestSuite(TestSuiteContext testSuiteContext) {
println "TestListener3 ran and finished"
}
}
I wrote “Test Cases/TC1” as follows:
println "TC1 ran and finished"
I made “Test Suites/TS1” as follows
I ran the “Test Suites/TS1”, then I got the following output in the console:
11月 14, 2024 6:45:08 午前 com.kms.katalon.core.logging.KeywordLogger startSuite
情報: START Test Suites/TS1
11月 14, 2024 6:45:08 午前 com.kms.katalon.core.logging.KeywordLogger logRunData
情報: hostName = kazuakiurayama - localhost
11月 14, 2024 6:45:08 午前 com.kms.katalon.core.logging.KeywordLogger logRunData
情報: os = Mac OS X 64bit
11月 14, 2024 6:45:08 午前 com.kms.katalon.core.logging.KeywordLogger logRunData
情報: hostAddress = 127.0.0.1
11月 14, 2024 6:45:08 午前 com.kms.katalon.core.logging.KeywordLogger logRunData
情報: katalonVersion = 10.0.0.223
TestListener2 started
TestListener3 started
11月 14, 2024 6:45:09 午前 com.kms.katalon.core.logging.KeywordLogger startTest
情報: --------------------
11月 14, 2024 6:45:09 午前 com.kms.katalon.core.logging.KeywordLogger startTest
情報: START Test Cases/TC1
TC1 ran and finished
11月 14, 2024 6:45:09 午前 com.kms.katalon.core.logging.KeywordLogger endTest
情報: END Test Cases/TC1
TestListener2 ran and finished
TestListener3 ran and finished
11月 14, 2024 6:45:09 午前 com.kms.katalon.core.logging.KeywordLogger logInfo
情報: Start generating HTML report folder at: /Users/kazuakiurayama/katalon-workspace/healthcare-tests2/Reports/20241114_064503/TS1/20241114_064503...
...
I could see that the TestListener2
and TestListener3
ran and finished.
I mean, I could see that Katalon Studio called 2 TestListeners successfully.
So I do not understand what you wrote:
By the way, in which order TestListener2
and TestListner3
will be executed? How can I change the sequence so that TestListener3
runs before TestListener2
? ---- I don’t think it is possible. Katalon Studio determines the sequence. No way I can specify the sequence.