Inconsistent Cucumber Execution: Works in Sample Project, Fails in Others

Summary
Cucumber feature files are not executing in Katalon Studio 10.2.4 on certain projects. Although setup is correct (step definitions, Gherkin syntax, glue code), execution fails or shows glue not matched error. Works in one sample project but fails in others with the same structure.

Steps to reproduce

  1. Create a new Katalon Studio project.
  2. Add a Cucumber feature file in Include/features/Web.feature:
    Feature: Hello feature
      Scenario: Print Hello
        Given I print hello
    
  3. Create a corresponding step definition in Include/scripts/groovy/stepdefs/WebDef.groovy:
    package stepdefs
    
    import cucumber.api.java.en.Given
    
    class WebDef {
      @Given("I print hello")
      def iPrintHello() {
        println "✅ Hello printed from Katalon step definition"
      }
    }
    
  4. Call from a test case:
    import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
    CucumberKW.runFeatureFile('Include/features/Web.feature')
    
    

Expected Results
Feature file should execute and console should show:
:white_check_mark: Hello printed from Katalon step definition

Actual Results

  • Feature file does not execute
  • Right-click > Run with Cucumber does nothing or fails silently
  • Error shown in logs:
    java.lang.UnsupportedClassVersionError:
    META-INF/versions/21/com/fasterxml/jackson/core/io/doubleparser/FastDoubleSwar
    has been compiled by a more recent version of the Java Runtime (class file version 65.0),
    this version of the Java Runtime only recognizes class file versions up to 61.0
  • In some cases:
    Glue code does not match step definition

*Screenshots / Videos

*Blocker?
Yes


*Operating System
Windows 10 pro

*Katalon Studio version
version 10.2.4

*Katalon Studio logs
Windows logs folder: Katalon Studio folder>\config\.metadata\.log

Environment (for Web Testing)
Browser: Chrome 125.0.6422.113

Environment (for Mobile Testing)
N/A

2 Likes

Solution: Fix Java Compatibility Errors & Dependency Conflicts in Katalon Studio

Step 1: Check Java Runtime Compatibility
The primary error indicates a Java class version mismatch:

class file version 65.0 (Java 21) required by Jackson, but only supports up to 61.0 (Java 17).
Action:

  1. Upgrade Java to 21 (Recommended):
  • Download JDK 21
  • Set it as default in Katalon:
    File > Settings > Java Development Kits > Select Java 21
  1. If upgrade isn’t possible:
    3.Downgrade conflicting dependencies* (e.g., Jackson) to versions compatible with Java 17. Check if older versions (e.g., Jackson 2.18.0) work with your Cucumber plugins.

Step 2: Investigate Cucumber/Jackson Dependencies
The error stems from Jackson’s FastDoubleSwar class in a project’s dependencies.

Troubleshoot:

  1. Check Project Dependencies (if using Gradle/Maven):

groovy

// Example: Gradle Build Script
dependencies {
    implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.0' // Java 11+ compatible
    testImplementation 'io.cucumber:cucumber-java:7.13.0' // Ensure alignment with Cucumber version
}
  1. Forbid Transitive Dependencies (if using Gradle):
    Add constraints to block incompatible versions:

groovy

configurations.all {
    resolutionStrategy {
        force 'com.fasterxml.jackson.core:jackson-databind:2.18.0'
    }
}

Step 3: Validate Cucumber Configuration
Since the sample project works, cross-compare configurations:

  1. Step Definition Package Structure:
    Ensure stepdefs aligns with Include/scripts/groovy/stepdefs in Build Path:

text

Project > Properties > Java Build Path > Add Source Folder: Include/scripts/groovy
  1. Browser Automation Libraries:
    Confirm that ChromeDriver matches Chrome v125.0.6422.113:

kotlin

// Web.config: Example Chrome Config
DesiredCapabilities.chrome() {
    setCapability('browserVersion', '125.0.6422.113')
}

Step 4: Debugging Steps

  1. Clear Katalon Cache:

text

Katalon Studio > Help > Clear Cache
Restart Studio
  1. Check Console Logs:
    Locate katalon.log under:

text

C:\%USER%.kks\10.2.4\.metadata\.log (Windows)
  1. Test Case Setup:
    Ensure CucumberBuiltinKeywords is imported correctly:

groovy

import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
CucumberKW.runFeatureFile('Include/features/Web.feature', DrivingLicense.CURRENT)

Impact Matrix

Approach Pros Cons
Upgrade Java 21 Full compatibility May require admin rights
Downgrade Jackson Fallback for Java 17 Verify compatibility with Cucumber
Force Dependency Versions Prevents conflicts May break other features

Expected Outcome
After addressing the Java/Jackson mismatch:
✓ Feature files execute with :white_check_mark: Hello printed” in console
✓ No UnsupportedClassVersionError
✓ Glue code matches step definitions (verify @Given syntax in Groovy)

1 Like

Here is a solution proved working:

1 Like

:white_check_mark: Issue Solved – Big Thanks to the Katalon Community! :folded_hands:
Hi @kazurayam @dineshh

Thank you for sharing your solutions with me!

I was facing the UnsupportedClassVersionError (class file version 65.0 vs 61.0), and it had me stuck for a while. Thanks to the helpful suggestions and support from the Katalon Community, I was able to identify the problem with the JAR compatibility and resolve it by using Java 17-supported libraries.

Really appreciate the guidance and quick responses. It’s great to be part of such a responsive and knowledgeable group. Looking forward to learning more and contributing back! :raising_hands:

– Umar Farook

2 Likes