🛠️ Custom Keywords: Show us your most useful 'Hack'!

Hey Katalon Community!

We’ve all been there: you’re automating a complex scenario and realize the built-in keywords just aren’t cutting it. Maybe it’s a tricky shadow DOM, a specific date-picker, or a complex database validation.

That’s where Custom Keywords save the day. They are the secret sauce that turns a “good” test suite into a “great,” maintainable one.

I’m curious to see how you all are extending Katalon’s power.

My Favorite Use Case:

Personally, I love using Custom Keywords for cleaning up dynamic test data after a run. It keeps the environment fresh and prevents those annoying “Duplicate Entry” errors on the next execution.

The Challenge:

What is one Custom Keyword you’ve written that you now use in almost every project?

  • Is it a JavaScript executor for tricky clicks?

  • A random string generator for unique emails?

  • A custom logger that makes your reports look beautiful?

  • Or maybe a waiting strategy that finally killed off your flaky tests?

Share a snippet or just describe what it does below! Let’s build a “cheat sheet” of hacks that we can all learn from. :rocket:

#KatalonStudio #TestAutomation #CustomKeywords #BestPractices #SoftwareTesting

Hi there, and thanks for posting in the Katalon community! :hugs:

To help you faster, please review our guide on Custom Keyword here: Introduction to custom keywords in Katalon Studio | Katalon Docs. Double-checking the steps and configurations might resolve the issue.

If the doc doesn’t help, feel free to provide more details, and a community member will assist you soon. Thanks for being a part of our community!

Best,
Elly Tran

Dynamic reading PDF, I cant share Keyword as code is submitted and i have no longer access to that repo, but once wrote again i will share it here, its great to see Custom Keywords other QAs develop to get help from

I’m planning to implement it.
Can you please share you approach and tools/libraries used.

Thanks in advance.

My top hack: Smart Wait that polls multiple conditions (visible + clickable + stable) vs. fragile waitForElementPresent.

SmartWait Keyword

static void smartWait(TestObject to, int timeout) {
    WebUI.waitForElementVisible(to, timeout)
    WebUI.waitForElementClickable(to, timeout)
    WebUI.executeJavaScript("arguments[0].scrollIntoView({block: 'center'})", Arrays.asList(to))
    WebUI.delay(1) // Stabilize animations
}

Usage: CustomKeywords.smartWait(findTestObject('dynamicBtn'), 10) kills 90% flakiness.