javaseleniumjunitcucumberautomation-testing

How to run multiple tags in CucumberOptions


I've two different feature files 1 has @Feature1 and 2 has @Feature2 I want to run only these two features with tags My TestRunner code this gives sytnax error on tags

@RunWith(Cucumber.class)
@CucumberOptions(
        features = "src/main/resources/features",
        glue = "stepDefinition",
        tags = {"@Feature1", "@Feature2"}
)

Solution

  • To execute multiple tag one after another you need to use or . See example below

    tags=“@tag1 or @tag2”