Trace -- java.lang.NoSuchMethodError: io.cucumber.tagexpressions.TagExpressionParser: method 'void <init>()' not found
Hi,
I am facing below error while running the test script from jmeter.
Error -- runTest(org.apache.jmeter.protocol.java.sampler.JUnitSampler$AnnotatedTestCase): io.cucumber.tagexpressions.TagExpressionParser: method 'void
Having below snipets of code: package runner;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.junit.Test;
import io.cucumber.core.cli.Main;
public class TestRunner {
public ClassLoader load;
private static Logger Log = LogManager.getLogger(TestRunner.class);
protected TestRunner(String str) {
// TODO Auto-generated constructor stub
this();
}
public TestRunner() {
// TODO Auto-generated constructor stub
}
// Test method is defined with Cucumber Main run method.
// "-g" signifies glue code (package where the code is), "-t" signifies the tag.
// The location of the feature file which defines the test scripts
@Test
public void runTest() throws Throwable {
try {
Main.run(new String[] { "-g", "step_definitions", "-t", "@upload",
"src/test/resources/features/addcontent.feature" }, ClassLoader.getSystemClassLoader());
Log.info("Print");
} catch (Exception e) {
e.printStackTrace();
}
}
// Post Test what the JUNIT test needs to do
}
and added below dependencies in lib folder: cobertura-2.1.1.jar tag-expressions-3.0.0.jar gherkin-15.0.2 (1).jar cucumber-gherkin-6.5.1.jar cucumber-plugin-6.5.1.jar slf4j-api-1.7.9.jar joda-time-2.10.6.jar commons-lang3-3.10.jar commons-codec-1.14.jar mockito-core-3.5.5.jar gherkin-15.0.2.jar cucumber-jvm-deps-1.0.6.jar cucumber-junit-5.7.0.jar cucumber-java-5.7.0.jar cucumber-core-5.7.0.jar cobertura-1.8.jar
Please help me to solve this issue.