You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cucumber.runtime.CucumberException: No such field
mypackage.model.Person.birthPlace
at cucumber.runtime.table.TableConverter.toListOfComplexType(TableConverter.java:106)
at cucumber.runtime.table.TableConverter.convert(TableConverter.java:91)
at cucumber.runtime.StepDefinitionMatch.tableArgument(StepDefinitionMatch.java:97)
at cucumber.runtime.StepDefinitionMatch.transformedArgs(StepDefinitionMatch.java:74)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
at cucumber.runtime.Runtime.runStep(Runtime.java:300)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:102)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:95)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:38)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.api.junit.Cucumber.run(Cucumber.java:100)
at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:38)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:532)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1179)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:1030)
with the following feature:
Feature: Create accountScenario: Save person dataGiven the authenticated person fills the form with:
| name | ... | birthPlace | ... | | Ann | | Paris | ... |
with the following scenario:
@Given("^the authenticated person fills the form with:$")
publicvoidtheAuthenticatedPersonFillsTheFormWith(List<Person> personList) throwsThrowable {
...
Cucumber-JVM uses a 3rd party library, XStream (http://x-stream.github.io/), to do automatic conversions. It's extremely unlikely that we'll be adding this automatic conversion.
You could convert to one of the more generic List/Map formats (or use DataTable) and write a simple adaptor.
Summary
I get the exception:
with the following feature:
with the following scenario:
and with the following Person bean:
Expected Behavior
Cucumber should be able to convert the data table in the
List<Person>
.Current Behavior
Cucumber is not able to understand the existence of the property
birthPlace
, even if existgetBirthPlace
andsetBirthPlace
.Possible Solution
1
Add
private String birthPlace;
toPerson
bean, but I don't like having to change my model to run cucumber test.2
Leave DataTable as method parameter type:
and convert manually to
List<Person>
. I'll go for this boring solution.Steps to Reproduce (for bugs)
See summary example, then run cucumber.
Context & Motivation
I'd like to use my rich data model.
Your Environment
OS: Windows 7 professional
IDE: Netbeans
JARS:
The text was updated successfully, but these errors were encountered: