I would tell you what’s going on internally.
When I finished running the main
, I found a file test/Libs/TempTestCase1674532629355.groovy
under the project folder, which looks like:
import com.kms.katalon.core.main.TestCaseMain
import com.kms.katalon.core.logging.KeywordLogger
import com.kms.katalon.core.testcase.TestCaseBinding
import com.kms.katalon.core.driver.internal.DriverCleanerCollector
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.configuration.RunConfiguration
import com.kms.katalon.core.webui.contribution.WebUiDriverCleaner
import com.kms.katalon.core.mobile.contribution.MobileDriverCleaner
import com.kms.katalon.core.cucumber.keyword.internal.CucumberDriverCleaner
import com.kms.katalon.core.windows.keyword.contribution.WindowsDriverCleaner
import com.kms.katalon.core.testng.keyword.internal.TestNGDriverCleaner
DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.webui.contribution.WebUiDriverCleaner())
DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.mobile.contribution.MobileDriverCleaner())
DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.cucumber.keyword.internal.CucumberDriverCleaner())
DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.windows.keyword.contribution.WindowsDriverCleaner())
DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.testng.keyword.internal.TestNGDriverCleaner())
RunConfiguration.setExecutionSettingFile('/var/folders/7m/lm7d6nx51kj0kbtnsskz6r3m0000gn/T/Katalon/Test Cases/main/20230124_125709/execution.properties')
TestCaseMain.beforeStart()
TestCaseMain.runTestCase('Test Cases/main', new TestCaseBinding('Test Cases/main',[:]), FailureHandling.STOP_ON_FAILURE , false)
Katalon Studio generated this .groovy file out of the source code of Test Cases/main
.
If you read the code, you would find that the method runTestCase(String, TestCaseBinding)
of the com.kms.katalon.core.main.TestCaseMain
class is the entry point into the drama.
The source of this this class is published at
At the line#136,
public static TestResult runTestCase(String testCaseId, TestCaseBinding testCaseBinding,
FailureHandling flowControl, boolean isMain, boolean doCleanUp) throws InterruptedException {
Thread.sleep(DELAY_TIME);
InternalTestCaseContext testCaseContext = new InternalTestCaseContext(testCaseId);
testCaseContext.setMainTestCase(isMain);
return new TestCaseExecutor(testCaseBinding, engine, eventManager, testCaseContext, doCleanUp)
.execute(flowControl);
}
The fragment new TestCaseExecutor(testCaseBinding, engine, ...
is important.
What is the engine
variable?
If you read the source of this class carefully, you would find the engine
is the instance of the Groovy language runtime.