import com.kms.katalon.core.annotation.BeforeTestSuite
import com.kms.katalon.core.context.TestSuiteContext
class TL1 {
@BeforeTestSuite
def sampleBeforeTestSuite(TestSuiteContext testSuiteContext) {
println "TestSuiteId is " + testSuiteContext.getTestSuiteId()
}
}
When I ran the “Test Suite/TS1”, I got the following output in the console:
2024-02-25 07:50:42.534 INFO c.k.katalon.core.main.TestSuiteExecutor - START Test Suites/TS1
2024-02-25 07:50:42.629 INFO c.k.katalon.core.main.TestSuiteExecutor - hostName = kazuakiurayama - localhost
2024-02-25 07:50:42.631 INFO c.k.katalon.core.main.TestSuiteExecutor - os = Mac OS X 64bit
2024-02-25 07:50:42.633 INFO c.k.katalon.core.main.TestSuiteExecutor - hostAddress = 127.0.0.1
2024-02-25 07:50:42.634 INFO c.k.katalon.core.main.TestSuiteExecutor - katalonVersion = 9.0.0.212
TestSuiteId is Test Suites/TS1
2024-02-25 07:50:42.908 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2024-02-25 07:50:42.908 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/TC1
Start recording video for test case 'Test Cases/TC1'.
TC1 ran
2024-02-25 07:50:45.804 INFO c.k.k.c.c.internal.VideoRecorderService - Video recording for test case 'Test Cases/TC1' .
2024-02-25 07:50:45.808 INFO c.k.katalon.core.main.TestCaseExecutor - END Test Cases/TC1
2024-02-25 07:50:46.137 INFO com.kms.katalon.core.util.KeywordUtil - Start generating HTML report folder at: /Users/kazuakiurayama/katalon-workspace/test/Reports/20240225_075036/TS1/20240225_075036...
2024-02-25 07:50:46.192 INFO com.kms.katalon.core.util.KeywordUtil - HTML report generated
2024-02-25 07:50:46.194 INFO com.kms.katalon.core.util.KeywordUtil - Start generating CSV report folder at: /Users/kazuakiurayama/katalon-workspace/test/Reports/20240225_075036/TS1/20240225_075036...
2024-02-25 07:50:46.222 INFO com.kms.katalon.core.util.KeywordUtil - CSV report generated
2024-02-25 07:50:46.311 INFO c.k.katalon.core.main.TestSuiteExecutor - --------------------
2024-02-25 07:50:46.311 INFO c.k.katalon.core.main.TestSuiteExecutor - END Test Suites/TS1
2024-02-25 07:50:46.311 INFO c.k.katalon.core.main.TestSuiteExecutor - ====================
This looks fine. @BeforeTestSuite-annoted method in the TL1 was invoked.
On the other hand, when I ran the Test Case/TC1, I got the following output:
2024-02-25 07:52:57.329 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2024-02-25 07:52:57.333 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/TC1
TC1 ran
2024-02-25 07:52:57.599 INFO c.k.katalon.core.main.TestCaseExecutor - END Test Cases/TC1
@antara.kumari you are looking for the result in the wrong place.
the log viewer shows that your testcase executed properly. and the executed command.
and that is fine.
however, will not show the result of the println command.
guess why? because that command will output to the console.
this is how print commands works.
so, perhaps try to look into the other tab?