Quantcast
Channel: Pochampalli IT Labs
Viewing all articles
Browse latest Browse all 261

Tip : None of the features at [classpath:features] matched the filters: [@scenario_AddMarketingAccount, @scenario_AddMarketingUser] OR tags for command line execution of cucumber scenarios

$
0
0
Hi,

If we try to provide tags individually as below in main method for command line usage, we may end-up getting the error message saying .. None of the features at classpath matched the filters.

"-t","@scenario_AddMarketingAccount,
"-t","@scenario_AddMarketingUser",


None of the features at [classpath:features] matched the filters: [@scenario_AddMarketingAccount, @scenario_AddMarketingUser]

0 Scenarios

0 Steps
0m0.000s

Provide a single tag with comma separated literals/scenario tags. 
i.e., 
"-t","@scenario_AddMarketingAccount,@scenario_AddMarketingUser"

Below is how the tags should be written for CLI (command line interface)

package com.sadakar.selenium.common;
importorg.openqa.selenium.WebDriver;

publicclassBasePage{

publicstatic WebDriver driver;

publicstaticvoidmain(String args[])throws Throwable{
try{
cucumber
.api.cli.Main.main(
new String[]{
"classpath:features",
"-g","com.sadakar.cucumber.stepdefinitions/",
"-g","com.sadakar.cucumber.common",
"-t","@scenario_AddMarketingAccount,@scenario_AddMarketingUser",
"-p","pretty",
"-p","json:target/cucumber-reports/Cucumber.json",
"-p","html:target/cucumber-reports",
"-m"
}
);
}
catch(Throwable e){
e
.printStackTrace();
System
.out.println("Main method exception");
}
}
}


NOTE : 
When you run executable jar file, it executes ALL the scenarios given with "-t" tag.

1) Build the jar file 
clean compile assembly:single install

2) Run the jar file
java -DtestEnv=local -jar SADAKAR_POC-0.0.1-SNAPSHOT-jar-with-dependencies.jar

Viewing all articles
Browse latest Browse all 261

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>