如何在高度详细的&中记录错误空手道中的准确表格,以供用户在出错时参考 [英] How to log errors in highly detailed & accurate form in Karate for user reference during errors

查看:53
本文介绍了如何在高度详细的&中记录错误空手道中的准确表格,以供用户在出错时参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试一个不断与数据库通信的应用程序.无论何时,无论找不到数据还是列名不正确或其他任何原因,存储过程执行都会出错.我的空手道测试仅返回400错误连接超时异常消息(一条通用消息!).

I am testing an application that constantly communicates with Database. Whenever, there is an error with the Stored Proc execution, whether no data found or incorrect column name or anything else; my karate test just returns 400 error connection timeout exception message (a generic message!).

我尝试仔细阅读空手道生成的默认日志,但错误未详细说明&;足够准确.

I have tried perusing through the default logs generated by Karate, but the errors are not detailed & accurate enough.

我想要的是,空手道应该以详细的形式报告错误.例如,是什么引起了错误?存储过程中的参数是否不正确?或数据库表不存在?或无法连接到数据库,无效的用户ID等.如何在空手道中实现这一目标?

What i want is that, Karate should report the error in detailed form. Such as, what caused the error? whether it is incorrect parameters in Stored proc? or DB Table non- existent? or could not connect to DB., Invalid User ID, etc. How can i achieve that in Karate?

推荐答案

空手道是用于HTTP测试的,它可以很好地报告错误.

Karate is for HTTP testing and for that it does a great job reporting errors.

我猜您使用了一个自定义Java实用程序来进行数据库调用,请注意,您完全控制了该代码,而Karate与它无关.有关更多详细信息,请参见以下答案: https://stackoverflow.com/a/46964277/143475 : https://stackoverflow.com/a/52078427/143475

I'm guessing you used a custom Java utility to make database calls and please note that you are completely in control of that code and Karate has nothing to do with it. For more details, please see this answer: https://stackoverflow.com/a/46964277/143475 and also this one: https://stackoverflow.com/a/52078427/143475

如果您没有编写连接数据库的代码,请抓住这样做的人-并向他/她询问这些问题.祝一切顺利!

If you didn't write the code to connect to the database, catch hold of the person who did - and ask these questions to him / her. All the best !

这篇关于如何在高度详细的&中记录错误空手道中的准确表格,以供用户在出错时参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆