Discussion:
[Cucumber] DocString stops working when using default JacksonTableTransformer
Add Reply
Aniruddha chatterjee
2018-10-24 16:15:51 UTC
Reply
Permalink
All the steps with DocString throws exception listed below when I start
using the default JacksonTableTransformer as explained here here
<https://cucumber.io/blog/2018/09/24/announcing-cucumber-jvm-4-0-0>. This
works when I don't use the default JacksonTableTransformer.

Cucumber step :-


Then Assert XML Response

"""

Some Value

"""


Exception stack trace :-

cucumber.runtime.CucumberException: Could not convert arguments for step [^
Assert XML Response$] defined at '*.assertXMLResponse(String) in file:**
/target/classes/'.



The details are in the stacktrace below.

at cucumber.runner.PickleStepDefinitionMatch.couldNotConvertArguments(
PickleStepDefinitionMatch.java:69)

at cucumber.runner.PickleStepDefinitionMatch.runStep(
PickleStepDefinitionMatch.java:46)

at cucumber.runner.TestStep.executeStep(TestStep.java:63)

at cucumber.runner.TestStep.run(TestStep.java:49)

at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:43)

at cucumber.runner.TestCase.run(TestCase.java:44)

at cucumber.runner.Runner.runPickle(Runner.java:40)

at cucumber.api.testng.TestNGCucumberRunner.runScenario(
TestNGCucumberRunner.java:68)

at cucumber.api.testng.AbstractTestNGCucumberTests.runScenario(
AbstractTestNGCucumberTests.java:22)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.testng.internal.MethodInvocationHelper.invokeMethod(
MethodInvocationHelper.java:86)

at org.testng.internal.Invoker.invokeMethod(Invoker.java:643)

at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)

at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)

at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.
java:129)

at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.
java:615)

at java.lang.Thread.run(Thread.java:745)

Caused by: io.cucumber.datatable.CucumberDataTableException: Can't convert
DataTable to java.lang.String. The table contained more then one item: []

at
io.cucumber.datatable.CucumberDataTableException.cantConvertTo(CucumberDataTableException.java:19)


at
io.cucumber.datatable.DataTableTypeRegistryTableConverter.toSingleton(DataTableTypeRegistryTableConverter.java:113)


at
io.cucumber.datatable.DataTableTypeRegistryTableConverter.convert(DataTableTypeRegistryTableConverter.java:75)


at io.cucumber.datatable.DataTable.convert(DataTable.java:362)

at
io.cucumber.stepexpression.StepExpressionFactory$4.transform(StepExpressionFactory.java:86)


at
io.cucumber.stepexpression.DocStringArgument.getValue(DocStringArgument.java:15)


at
cucumber.runner.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:41)


... 20 more
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
aslak hellesoy
2018-10-24 16:26:23 UTC
Reply
Permalink
Please submit a bug report to cucumber-cucumber-jvm in github.

Thanks
Aslak
Post by Aniruddha chatterjee
All the steps with DocString throws exception listed below when I start
using the default JacksonTableTransformer as explained here here
<https://cucumber.io/blog/2018/09/24/announcing-cucumber-jvm-4-0-0>. This
works when I don't use the default JacksonTableTransformer.
Cucumber step :-
Then Assert XML Response
"""
Some Value
"""
Exception stack trace :-
cucumber.runtime.CucumberException: Could not convert arguments for step
[^Assert XML Response$] defined at '*.assertXMLResponse(String) in file:**
/target/classes/'.
The details are in the stacktrace below.
at cucumber.runner.PickleStepDefinitionMatch.couldNotConvertArguments(
PickleStepDefinitionMatch.java:69)
at cucumber.runner.PickleStepDefinitionMatch.runStep(
PickleStepDefinitionMatch.java:46)
at cucumber.runner.TestStep.executeStep(TestStep.java:63)
at cucumber.runner.TestStep.run(TestStep.java:49)
at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:43)
at cucumber.runner.TestCase.run(TestCase.java:44)
at cucumber.runner.Runner.runPickle(Runner.java:40)
at cucumber.api.testng.TestNGCucumberRunner.runScenario(
TestNGCucumberRunner.java:68)
at cucumber.api.testng.AbstractTestNGCucumberTests.runScenario(
AbstractTestNGCucumberTests.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.testng.internal.MethodInvocationHelper.invokeMethod(
MethodInvocationHelper.java:86)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:643)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
at org.testng.internal.TestMethodWorker.invokeTestMethods(
TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.
java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: io.cucumber.datatable.CucumberDataTableException: Can't
convert DataTable to java.lang.String. The table contained more then one
item: []
at
io.cucumber.datatable.CucumberDataTableException.cantConvertTo(CucumberDataTableException.java:19)
at
io.cucumber.datatable.DataTableTypeRegistryTableConverter.toSingleton(DataTableTypeRegistryTableConverter.java:113)
at
io.cucumber.datatable.DataTableTypeRegistryTableConverter.convert(DataTableTypeRegistryTableConverter.java:75)
at io.cucumber.datatable.DataTable.convert(DataTable.java:362)
at
io.cucumber.stepexpression.StepExpressionFactory$4.transform(StepExpressionFactory.java:86)
at
io.cucumber.stepexpression.DocStringArgument.getValue(DocStringArgument.java:15)
at
cucumber.runner.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:41)
... 20 more
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Aniruddha chatterjee
2018-10-24 16:36:43 UTC
Reply
Permalink
Thanks Aslak for the reply. Do you have any suggestion on how to by pass
this problem.Appreciate your help!

I have an alternate way to loop through all my customized cucumber data
table objects but some of them has a need to ignore enum value which I am
not able to do when directly doing defineDataTableType that I am able to do
when using Jackson's object mapper. If you have a suggestion there as well
that would be a great help.

Thanks,
Ani
Post by aslak hellesoy
Please submit a bug report to cucumber-cucumber-jvm in github.
Thanks
Aslak
Post by Aniruddha chatterjee
All the steps with DocString throws exception listed below when I start
using the default JacksonTableTransformer as explained here here
<https://cucumber.io/blog/2018/09/24/announcing-cucumber-jvm-4-0-0>.
This works when I don't use the default JacksonTableTransformer.
Cucumber step :-
Then Assert XML Response
"""
Some Value
"""
Exception stack trace :-
cucumber.runtime.CucumberException: Could not convert arguments for step
[^Assert XML Response$] defined at '*.assertXMLResponse(String) in
file:**/target/classes/'.
The details are in the stacktrace below.
at cucumber.runner.PickleStepDefinitionMatch.couldNotConvertArguments(
PickleStepDefinitionMatch.java:69)
at cucumber.runner.PickleStepDefinitionMatch.runStep(
PickleStepDefinitionMatch.java:46)
at cucumber.runner.TestStep.executeStep(TestStep.java:63)
at cucumber.runner.TestStep.run(TestStep.java:49)
at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:43)
at cucumber.runner.TestCase.run(TestCase.java:44)
at cucumber.runner.Runner.runPickle(Runner.java:40)
at cucumber.api.testng.TestNGCucumberRunner.runScenario(
TestNGCucumberRunner.java:68)
at cucumber.api.testng.AbstractTestNGCucumberTests.runScenario(
AbstractTestNGCucumberTests.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.testng.internal.MethodInvocationHelper.invokeMethod(
MethodInvocationHelper.java:86)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:643)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
at org.testng.internal.TestMethodWorker.invokeTestMethods(
TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: io.cucumber.datatable.CucumberDataTableException: Can't
convert DataTable to java.lang.String. The table contained more then one
item: []
at
io.cucumber.datatable.CucumberDataTableException.cantConvertTo(CucumberDataTableException.java:19)
at
io.cucumber.datatable.DataTableTypeRegistryTableConverter.toSingleton(DataTableTypeRegistryTableConverter.java:113)
at
io.cucumber.datatable.DataTableTypeRegistryTableConverter.convert(DataTableTypeRegistryTableConverter.java:75)
at io.cucumber.datatable.DataTable.convert(DataTable.java:362)
at
io.cucumber.stepexpression.StepExpressionFactory$4.transform(StepExpressionFactory.java:86)
at
io.cucumber.stepexpression.DocStringArgument.getValue(DocStringArgument.java:15)
at
cucumber.runner.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:41)
... 20 more
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...