Karate: How can I add scenario id to the logging config?

徘徊边缘 提交于 2019-12-06 06:31:06

I am not aware of any way to do that in log4j / logback. If you don't find anything I say why not print it in your test and it will show up in the HTML report.

Are you actually using the parallel runner ? Normally you never need to look at logs - because even if you run in parallel, you will get a nice HTML report for each scenario.

EDIT: an idea I haven't tried, if you see the Karate Gatling readme - it mentions how you can pass the karate object into JS or Java. If you use the ScriptBridge type, it has a log(...) method that you may be able to call from Java - which should output to the same logger as the currently executing Scenario. You may be able to come up with some custom strategy to prefix the scenario-id etc and log from your selenium code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!