How to use Spock framework for test automation instead of Cucumber in Katalon Studio?

Need to integrate the Spock framework structure for test automation in Katalon Studio
Could please guide me the steps:

  1. How to integrate the required libraries?
  2. How to run a script?

If you are already familiar with Spock framework and want to carry out your UI testing with it, then you are able to make a UI testing project with WebDriver + Spock + Gradle like the example, aren’t you? Why do you bother yourself for bringing Spock into Katalon Studio? Just messy, I think.

Trying to import the jar file of Spock and related libraries into the Drivers folder of your project would be possible by using com.katalon.gradle-plugin as described in Using AWS SDK in Katalon Studio, how to resolve external dependencies with Gradle.

You would be able to find a way to run a Spock-based scripts.

But in the end you would be disappointed that you can not obtain a good report from the tests ---- all you will obtain is the output into System.out. No pretty-formated reports will be available.

As for Cucumber, Katalon Team has integrated it into the Katalon Studio. I suppose that significant portion of their efforts were made for good reporting. You would miss it for Spock in KS.

1 Like

I have ever tried to run JUnit4 based tests in Katalon Studio.

In this example, you might find what is possible, and what is not.

By the junit4ks project, I learned that I can not obtain a “pretty formated test report” in KS. This shortage will apply to you and Spock as well.

1 Like

Thanks for the update

Thanks for sharing the details.


It’s really helpful for writing and executing jUnit test cases with the custom keyword.