I tried to run a Cucumber test with multiple tags.

But got this error.

I am using Cucumber version 5.7.0.

How can i run multiple tags now?

import org.junit.runner.RunWith;

import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;

        features = {"src/main/java/com/project1/features"},
        glue = {"com/project1/stepDefinitions"},
        plugin = {"pretty"},
        tags = {"@User1Login", "@User2Login"},
        monochrome = true

2 Answers 2


In Cucumber 5.7.0 the support of tags is handled in different way so that expression(infix boolean expression) can also be used in the same way. You can pass the multiple tags like

@CucumberOptions(tags = "@smoke and @positive")
public class RunCucumberTest {}

Another way to manage the tags by JVM System Property

mvn test -Dcucumber.filter.tags="@smoke and @positive"

Option --scenario or pattern file.feature:line is a way to run a subset of scenarios

Ref: https://github.com/cucumber/cucumber-jvm/pull/1955

Here the Changelog of 5.7.0 https://github.com/cucumber/cucumber-jvm/blob/master/CHANGELOG.md


-Dcucumber.filter.tags="(@smoke or @dry)" You can also use -Dcucumber.filter.tags="(@smoke or @dry) and not @positive".

Add this to CucumberOption to run the tags from your test runner class: tags = "(@smoke or @dry)"


tags = "(@smoke or @dry) and not @positive"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.