Got java.lang.ArrayIndexOutOfBoundsException:55 after run a feature file

getting the below error after running a faeature file ERROR c.k.k.core.keyword.internal.KeywordMain - :x: Keyword runFeatureFile was failed (Root cause: java.lang.ArrayIndexOutOfBoundsException: 55
at cucumber.runtime.formatter.TestSourcesModel.getKeywordFromSource(
at cucumber.runtime.formatter.JUnitFormatter$TestCase.getKeywordFromSource(
at cucumber.runtime.formatter.JUnitFormatter$TestCase.addStepAndResultListing(
at cucumber.runtime.formatter.JUnitFormatter$TestCase.addTestCaseElement(
at cucumber.runtime.formatter.JUnitFormatter.handleTestCaseFinished(
at cucumber.runtime.formatter.JUnitFormatter.access$300(

could anyone help me on this please, also I have referred the forum which someone has posted same issue, but no solution for java.lang.ArrayIndexOutOfBoundsException: 28 after run a feature file - #5 by andyca

To me, this seems to be due to some bug in Katalon Studio.

You need to ask Katalon developers to look at it.

This Katalon Forum is a community of users who have no capability to debug Katalon products.

@Elly_Tran @vu.tran

I found the source code of cucumber.runtime.formatter.TestSourcesModel.getKeywordFromSource( at

    String getKeywordFromSource(String uri, int stepLine) {
        Feature feature = getFeature(uri);
        if (feature != null) {
            TestSourceRead event = getTestSourceReadEvent(uri);
            String trimmedSourceLine = event.source.split("\n")[stepLine - 1].trim();   // ArrayIndexOutOfBoundsException is raised here

If the stepLine variable has 0 value, then an ArrayIndexOutOfBoundsException will be raised.

I believe @shabana.sreenivasulu saw it.

You can check which version of the cumber-jvm project Katalon uses. See the .classpath file in your Katalon project. Katalon Studio v8.6.5 uses v3.0.2 of the cucumber-jvm library.

	<classpathentry kind="lib" path="/Applications/Katalon"/>
	<classpathentry kind="lib" path="/Applications/Katalon"/>
	<classpathentry kind="lib" path="/Applications/Katalon"/>
	<classpathentry kind="lib" path="/Applications/Katalon"/>
	<classpathentry kind="lib" path="/Applications/Katalon"/>
	<classpathentry kind="lib" path="/Applications/Katalon"/>
	<classpathentry kind="lib" path="/Applications/Katalon"/>
	<classpathentry kind="lib" path="/Applications/Katalon"/>
	<classpathentry kind="lib" path="/Applications/Katalon"/>

The v3.0.2 of cucumber-jvm is very old. The latest version is v7.13.0.

As you see, Katalon Studio is not in sync with the cucumber-jvm project.

It is quite likely that the v3.0.2 had some bugs. These bugs would have been fixed in the later versions; but Katalon Studio is not able to benefit these fixes.


Unfortunately, this issue will be very difficult for Katalon team to fix. They would have to start with upgrading the external dependencies (e.g., to cucumber-jvm.7.13.0). It will inevitably involve a lot of work.

In April this year, @duyluong wrote that they will work on “overhauling” their product to catch up the latest version of various external dependencies;

However we haven’t heard of any progress of the great attempt yet.

Katalon Studio provides a way to replace the external dependencies while excluding the bundled old versions:

I suppose that you will get problems if you try to replace the bundled old version cucumber-*.jars to a newer version. Why?

Since version 4.5.0 the package cucumber.api.junit.Cucumber has moved to io.cucumber.junit.Cucumber and package cucumber.api.CucumberOptions has moved to io.cucumber.junit.CucumberOptions

This change of package name from cucumber.* to io.cucumber.* is quite significant. Any code dependent on the cucumber.* package (v3.0.2) will fail to run with a cucumber of newer version (e.g, v7.13.0).


Thank you for sharing the issue. I will ask my internal team and back to you soon. We need to reproduce before confirming this as a bug. Thank you!

1 Like

Thanks @kazurayam , I have verified in the classpath file , the version is 3.0.2 which is the older version.

Thanks @Elly_Tran , waiting for your response.


can you please share the projects and step to reproduce so that my team can support? If you are a paid user, please help submit a ticket here Katalon Help Center. Thank you


Inside your lines of code (in test case or step definition), if you’re trying to call CucumberKW.runFeatureFile(), this error is displayed. Instead replace the Gherkin lines from a feature file you’re calling to the current feature file that is running, the issue got addressed. Please try and share your thoughts.

Basically I’m calling another feature in one feature file to get the variable values to be used in current feature file using call Testcase() as we can’t use varaiables in one feature file to another. That time I’m getting this error in current feature file.

Are you sure that the “one feature file” is always present?

I guess, when you miss the “one feature file” on disk, you get the java.lang.ArrayIndexOutOfBoundsException; don’t you?

In that case, your code should check if the “one feature files” is present or not before it calls the feature contained in the “one feature file”. If the file isn’t present, of course, your code should not go forward. You code should branch the processing as appropriate.

In feature file 1(actual file)> calling feature file 2 tests using call test case> In this I’m calling feature file 3 tests as I want to do all these feature file 3 and 2 before running feature file1.

When I run feature file1>it is calling feature file2> which calls feature file 3, and feature file 3 is running successfully and feature file2 all steps are running fine , but at the end I’m getting this exception.After that Feature file is also running the tests. But at the end I’m not able to see either test has passed or failed bit in console it is displaying this error.

All these feature files I’m running beacuse I want to use variables of feature file 2 and 3 in feature file file1