I am trying to print the value which I am feeding as input inside the CSV file. When run the below set of code through Junit and getting error. Could some one please help me to come out of this error and print the values successfully
@RunWith(ThucydidesParameterizedRunner.class)
@UseTestDataFrom(value="test-data/simple-data.csv", separator=';')
public class SampleCSVDataDrivenScenario {
private String name;
private String age;
private String address;
public SampleCSVDataDrivenScenario() {
}
@Qualifier
public String getQualifier() {
return name;
}
@Test
public void data_driven() {
System.out.println(getName() + "/" + getAge());
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
Please find the full error log below
java.lang.NoSuchMethodError:
org.junit.runners.model.FrameworkMethod.getDeclaringClass()Ljava/lang/Class;
at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:421)
at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:55)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at net.serenitybdd.junit.runners.SerenityRunner.run(SerenityRunner.java:252)
at org.junit.runners.Suite.runChild(Suite.java:127)
at org.junit.runners.Suite.runChild(Suite.java:26)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at net.serenitybdd.junit.runners.SerenityParameterizedRunner.run(SerenityParameterizedRunner.java:206)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
And this is how my CSV file looks like
NoSuchMethodError usually indicates a dependency conflict. You are possibly running the tests with an incompatible version of JUnit - make sure you are using the version of JUnit compatible with the version of Serenity you are using (Serenity has been built with JUnit 4.12 for a while now).