A fake KeywordLogger could integrate Extent Reports into Katalon project nicely

I have updated my demo project. It generates a html report compiled by Extent Reports, which includes

  • screenshots taken by Katalon Keywords on failure
  • Java stacktrace taken on keyword failure

With this change, the report compiled by Extent Reports covers the equivalent range of test execution logs as the Katalon built-in report covers.

The test case has nothing unusual; it looks just as an ordinary Katalon Test case, like this:

import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.testobject.ConditionType
import com.kms.katalon.core.testobject.TestObject
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

TestObject makeTestObject(String id, String xpath) {
	TestObject tObj = new TestObject(id)
	tObj.addProperty("xpath", ConditionType.EQUALS, xpath)
	return tObj
}
TestObject invalidBtn = makeTestObject("invalidBtn", "//a[@id='btn-make-disappointment']")

WebUI.openBrowser("http://demoaut.katalon.com/")
WebUI.verifyElementPresent(invalidBtn, 10, FailureHandling.CONTINUE_ON_FAILURE)
WebUI.closeBrowser()

Please note that you also have the source code in your hands so that you have a good chance to customize the report. For example, you can add “Git Branch Name: master” in the report as I did here.

However, as I mentioned in the original post, my project requires the com.kms.katalon.core.logging.KeywordLogger class to be modified. Only Katalon can do it in production; I can not change their proprietary product. So what I have done (the fake KeywordLogger class) will stay just a proof of concept.

Now I have done everything I wanted. It was a fun. I won’t do anymore on this issue.