有没有办法捕获空手道呼叫的请求和响应? [英] is there a way to capture karate call's request and response?
问题描述
我正在建立一个用于空手道执行的自定义报告,为此,我需要捕获功能文件名,方案/方案大纲名称,方案desc,已发送的请求以及响应状态和响应正文. 我知道我们可以使用karate.info捕获大多数项目,但是有没有一种方法可以捕获发出的请求和收到的响应?
I am building a custom report for karate execution and for that i need to capture the feature file name, scenario/scenario outline name, scenario desc, request sent and response status and response body. I know we can capture most of the items using karate.info, but is there a way to capture request made and response received ?
推荐答案
该响应在response
和responsebytes
中可用.
请求位于karate.prevRequest
中 https://github.com/intuit/karate #karate-prevrequest
我确实认为您正在做不必要的工作,因为默认情况下您会在HTML报告中看到这一点.
I do think you are doing un-necessary work, because you will see this in the HTML reports by default.
这篇关于有没有办法捕获空手道呼叫的请求和响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!