Getting exception while executing feature file. I

2019-08-19 08:15发布

Exception in thread "main" cucumber.runtime.CucumberException: Only one formatter can use STDOUT, now both pretty and json use it. If you use more than one formatter you must specify output path with PLUGIN:PATH_OR_URL at cucumber.runtime.formatter.PluginFactory.defaultOutOrFailIfAlreadyUsed(PluginFactory.java:185) at cucumber.runtime.formatter.PluginFactory.convertOrNull(PluginFactory.java:144) at cucumber.runtime.formatter.PluginFactory.instantiate(PluginFactory.java:99) at cucumber.runtime.formatter.PluginFactory.create(PluginFactory.java:87) at cucumber.runtime.RuntimeOptions.getPlugins(RuntimeOptions.java:241) at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:287) at com.sun.proxy.$Proxy0.uri(Unknown Source) at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:160) at cucumber.runtime.Runtime.run(Runtime.java:121) at cucumber.api.cli.Main.run(Main.java:36) at cucumber.api.cli.Main.main(Main.java:18)

1条回答
霸刀☆藐视天下
2楼-- · 2019-08-19 09:13

Just mention a complete path for the json report in the plugin value of CucumberOptions. Something like below

plugin = {  "pretty","json:target/json/report.json" }

The json report will be generated in the file and pretty plugin will use the console.

查看更多
登录 后发表回答