可以使用JMeter从数据库中删除记录吗? [英] Can JMeter be used to delete records from a database?

查看:438
本文介绍了可以使用JMeter从数据库中删除记录吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在与JMeter合作,对我正在研究的一组Servlet进行一些集成测试.现在,我有几个测试套件,它们可以执行不同的场景并声明servlet返回的响应.

I've been working with JMeter to put together some integration tests for a set of Servlets that I'm working on. I've now got several test suites that exercise different scenarios and assert on the responses sent back by the servlets.

我现在遇到的问题是,测试从一起运行时就没有一个干净的数据库可以工作,因此它们相互污染,并且失败了.

The problem I've now got is that the tests don't have a clean database to work from when they are run together, so they are polluting one another and failing.

文档建议在测试运行后,应使用JDBC PostProcessor清理数据库,但是我看不到编写删除表的删除语句的方法.

The documentation suggests that a JDBC PostProcessor should be used to clean up the database after a test runs, however I can't see a way to write a delete statement that will clear the tables down.

以前有人尝试过吗?

推荐答案

也许最好使用tearDown ThreadGroup.这样您就可以使用所需的任何采样器.因此,您可以使用JDBC Sampler执行您的DELETE语句.

perhaps it's better to use a tearDown ThreadGroup. In that you can use any Sampler you wish. So you can use a JDBC Sampler to execute your DELETE Statement.

http://jmeter.apache.org/usermanual/component_reference.html#tearDown_Thread_Group

这篇关于可以使用JMeter从数据库中删除记录吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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