# \[Cucumber\] Run with Cucumber Runner

**URL:** <https://forum.katalon.com/t/cucumber-run-with-cucumber-runner/34674>\
**Category:** Miscellaneous\
**Tags:** new-doc-request\
**Created:** [October 15, 2019, 6:56am UTC](https://forum.katalon.com/t/cucumber-run-with-cucumber-runner/34674 "2019-10-15T06:56:06Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![magesh.mariappan](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/magesh.mariappan/32/23869_2.png) [@magesh.mariappan](https://forum.katalon.com/u/magesh.mariappan)\
**Post date:** [February 20, 2022, 11:48am UTC](https://forum.katalon.com/t/cucumber-run-with-cucumber-runner/34674/21 "2022-02-20T11:48:17Z")

</div>

Hey @staniere , I am facing an issue with Cucumber keywords as they are not available in Katalon 8.2.5 version. can you suggest what would be the best solution ?  
A. Reinstall the Katalon Studio to lower version or something ?  
B. Reinstall the cucumber jar or anything ?  
C. Update any config detail and make it work ?

Appreciate your reply.

---

<div class="post-metadata">

**Author:** ![staniere](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/staniere/32/17333_2.png) [@staniere](https://forum.katalon.com/u/staniere)\
**Post date:** [March 8, 2022, 5:35pm UTC](https://forum.katalon.com/t/cucumber-run-with-cucumber-runner/34674/23 "2022-03-08T17:35:14Z")

</div>

hello @magesh.mariappan,  
I have no solution for the moment (always got an old cucumber version integrated in katalon).

I opened a ticket in katalon support and they said they will look at upgrading cucumber version in the future

for your problem, I have no idea sorry

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [March 8, 2022, 11:04pm UTC](https://forum.katalon.com/t/cucumber-run-with-cucumber-runner/34674/24 "2022-03-08T23:04:05Z")

</div>

@magesh.mariappan  
@staniere

Have a look at

[https://docs.katalon.com/katalon-studio/docs/external-libraries.html#exclude-built-in-libraries](https://docs.katalon.com/katalon-studio/docs/external-libraries.html#exclude-built-in-libraries)

Please pay attention to

> ## Exclude built-in libraries
> 
> With the ability to remove built-in libraries stored in the `.classpath` file of a project folder, you can replace a built-in library with an external one for flexible libraries usage in a test project.
> 
> **Important**  
> This feature applies to all libraries in `classpath` , excluding:  
> …

- `io.cucumber.*.jar`

> Excluding those libraries may cause failure of the relevant features.

As you see, **Katalon suggest to users not to try upgrading the `io.cucumber.*.jar`**.

But you could try it and see what happens.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [March 9, 2022, 12:20am UTC](https://forum.katalon.com/t/cucumber-run-with-cucumber-runner/34674/25 "2022-03-09T00:20:16Z")

</div>

> [@kazurayam](#):
>
> But you could try it and see what happens.

If you are going to try upgrading the `cucumber-core-*.jar`, you need to know

1. which old built-in jar you need to remove out of the `.classpath` file
2. which new version of jars you should copy into the `Drivers` folder

Here I assume you are sure you want the `cucumber-core-5.7.0.jar`. Then what else? The `cucumber-core-5.7.0.jar` would depend on other cucumber-_something_-x.x.x.jar so that you need to upgrade them at the same time. Unfortunately Katalon Studio provides no help to diagnose the dependency tree.

I would show you how to retrieve the dependency tree.

First you need to install [Gradle](https://gradle.org/) into your machine. You need to be able to do the following operation in the command line:

```auto
$ gradle -version

------------------------------------------------------------
Gradle x.x.x
------------------------------------------------------------

```

Change the `<projectDir>/build.gradle` file as follows:

```auto
ext {
  AUTO_IMPORTED_JAR_PREFIX = 'AUTOIMPORTED_'
}

repositories {
  mavenCentral()
  mavenLocal()
}

configurations {
  myconf
}

dependencies {
	// https://mvnrepository.com/artifact/io.cucumber/cucumber-core
	//myconf group: 'io.cucumber', name: 'cucumber-core', version: '7.2.3'
    myconf group: 'io.cucumber', name: 'cucumber-core', version: '5.7.0'

}

task drivers {
    doFirst {
        delete fileTree("Drivers") {
            include("**/" + AUTO_IMPORTED_JAR_PREFIX + "*")
        }
    }
    doLast {
        copy { copySpec ->
            copySpec
                .from(project.getConfigurations().getByName("myconf"))
                .into("Drivers")
                .include(
                    "**/cucumber*.jar",
                    )
                .rename({ s ->
                    AUTO_IMPORTED_JAR_PREFIX + s
                    })
        }
    }
}

```

Then in the command line you want to run the following command:

```auto
$ cd <projectDir>
$ gradle dependencies

> Task :dependencies

------------------------------------------------------------
Root project 'KS_upgrading_cucumber_jars'
------------------------------------------------------------

myconf
\--- io.cucumber:cucumber-core:5.7.0
     +--- io.cucumber:cucumber-gherkin:5.7.0
     | \--- io.cucumber:cucumber-plugin:5.7.0
     | \--- org.apiguardian:apiguardian-api:1.1.0
     +--- io.cucumber:cucumber-gherkin-vintage:5.7.0
     | \--- io.cucumber:cucumber-gherkin:5.7.0 (*)
     +--- io.cucumber:tag-expressions:2.0.4
     +--- io.cucumber:cucumber-expressions:8.3.1
     | \--- org.apiguardian:apiguardian-api:1.1.0
     +--- io.cucumber:datatable:3.3.1
     | \--- org.apiguardian:apiguardian-api:1.1.0
     +--- io.cucumber:cucumber-plugin:5.7.0 (*)
     +--- io.cucumber:docstring:5.7.0
     | \--- org.apiguardian:apiguardian-api:1.1.0
     \--- org.apiguardian:apiguardian-api:1.1.0

(*) - dependencies omitted (listed previously)

```

As you see Gradle tells you the dependency tree of `cucumber-core.0.5.7.jar`.

> I found that cucumber5.7.0 depends on `org.apiguardian:apiguardian-api`. Is it built-in KS? I am not sure.

You can try

```auto
$ gradle drivers

```

Then you will find several jar files are copied into the `Drivers` folder.

```auto
$ ls Drivers
AUTOIMPORTED_cucumber-core-5.7.0.jar
AUTOIMPORTED_cucumber-expressions-8.3.1.jar
AUTOIMPORTED_cucumber-gherkin-5.7.0.jar
AUTOIMPORTED_cucumber-gherkin-vintage-5.7.0.jar
AUTOIMPORTED_cucumber-plugin-5.7.0.jar

```

Now you have got 5 jars in the `Drivers` folder.

Finally, you have one more setup task to do. You want to follow the instruction at [the doc](https://docs.katalon.com/katalon-studio/docs/external-libraries.html#exclude-built-in-libraries), you should exclude the built-in 5 jars of old version built-in Katalon Studio.

You want to stop KS once, and restart it so that it acknowledges the newer jars prepared in the `Drivers` folder.

* * *

Please be warned that it is quite likely that upgrading `cucumber-core` causes error. It is quite possible that some code of Katalon Studio depends on the Cucumber API of v3.x, or some code of Katalon Studio does not understand the Cucumber API of v5.x. In that case, you should just give it up.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [March 9, 2022, 12:26am UTC](https://forum.katalon.com/t/cucumber-run-with-cucumber-runner/34674/26 "2022-03-09T00:26:59Z")

</div>

I found that KS v8.2.5 does not include the jar of `org.apiguardian`. Therefore you need to add it in the `Drivers` folder as well.

Please replace the `build.gradle` as follows`.

```auto
ext {
  AUTO_IMPORTED_JAR_PREFIX = 'AUTOIMPORTED_'
}

repositories {
  mavenCentral()
  mavenLocal()
}

configurations {
  myconf
}

dependencies {
	// https://mvnrepository.com/artifact/io.cucumber/cucumber-core
	//myconf group: 'io.cucumber', name: 'cucumber-core', version: '7.2.3'
    myconf group: 'io.cucumber', name: 'cucumber-core', version: '5.7.0'
    
    // https://mvnrepository.com/artifact/org.apiguardian/apiguardian-api
    myconf group: 'org.apiguardian', name: 'apiguardian-api', version: '1.1.0'

}

task drivers {
    doFirst {
        delete fileTree("Drivers") {
            include("**/" + AUTO_IMPORTED_JAR_PREFIX + "*")
        }
    }
    doLast {
        copy { copySpec ->
            copySpec
                .from(project.getConfigurations().getByName("myconf"))
                .into("Drivers")
                .include(
                    "**/cucumber*.jar",
                    "**/apiguardian-api*.jar"
                    )
                .rename({ s ->
                    AUTO_IMPORTED_JAR_PREFIX + s
                    })
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![philipB](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/philipb/32/16104_2.png) [@philipB](https://forum.katalon.com/u/philipB)\
**Post date:** [May 10, 2022, 2:07pm UTC](https://forum.katalon.com/t/cucumber-run-with-cucumber-runner/34674/27 "2022-05-10T14:07:46Z")

</div>

@kazurayam - How are you passing Cucumber tags at runtime when using the Cucumber runner?

It looks like global variables aren’t supported inside of a groovy class.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 10, 2022, 10:53pm UTC](https://forum.katalon.com/t/cucumber-run-with-cucumber-runner/34674/28 "2022-05-10T22:53:06Z")

</div>

> [@philipB](#):
>
> It looks like global variables aren’t supported inside of a groovy class.

The `internal.GlobalVariable` object is public. It is available for any groovy classes inside KS. If you find your class can’t get it, I guess your code has some mistakes. But you haven’t showed your code, logs, etc. So I do not see anything.

> [@\[TIP\] How To Help Us Help You!](http://forum.katalon.com/t/tip-how-to-help-us-help-you/12919/):
>
> My test is BROKEN! NOTHING WORKS! HELP ME! Relax. We get it. We really do. There are some pretty smart and clever people on this forum, but you must realize, they are not magicians or wizards or gods. They cannot see your code, they can’t see your errors and they don’t even know what your AUT is meant to do even though it might seem perfectly obvious to you. So please relax and follow the advice below, before you start writing your post. The advice below will tell you the exact information …

Please create a new post for your problem if you are going to raise a question.

---

<div class="post-metadata">

**Author:** ![chittk6](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/chittk6/32/30227_2.png) [@chittk6](https://forum.katalon.com/u/chittk6)\
**Post date:** [March 20, 2025, 3:54am UTC](https://forum.katalon.com/t/cucumber-run-with-cucumber-runner/34674/29 "2025-03-20T03:54:12Z")

</div>

I can not find the package: com.cucumber.testrunner.CucumberRunner to import. it’s error when I add the package.  
Please help. I have the same issue: groovy.lang.MissingPropertyException: No such property: CucumberRunner for class

[Previous page](https://forum.katalon.com/t/cucumber-run-with-cucumber-runner/34674.md?page=1)
