读取 JMeter 中创建的对象的 ID?
我们有 RESTfull 网络应用程序。
我们需要进行以下测试:
create 1000 students
view 1000 students
delete 1000 sudents
create 1000 students
view 1000 students
我们可以通过以下URL查看对象:/students/#id#
。
为此,我们应该知道所创建对象的 ID。
我们通过 CSV 文件创建学生,并期望他们从 1 开始,但如果数据库不清楚,则从更大的数字开始。
如何读取已创建学生的ID?
We have RESTfull web-application.
And we need to make the following test:
create 1000 students
view 1000 students
delete 1000 sudents
create 1000 students
view 1000 students
We can view object through the following URL: /students/#id#
.
And for do this we should to known IDs of created objects.
We create students via CSV-files and expect that they are beginning from 1, but if the database isn't clear in begins from bigger number.
How can we read IDs of created students?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信这就是您想要做的事情: 根据
要获取学生 ID,您需要执行一个名为正则表达式提取器的后处理器。
它读取源代码并可以将特定信息存储到变量名中。
然后将变量传递到 View 和 Delete 调用中。
链接: http://jmeter.apache.org/usermanual/component_reference.html#Regular_Expression_Extractor< /a>
你的 Jmeter 脚本看起来像这样:
--- 正则表达式抓取学生IDS
I believe this is what you're trying to do:
To get the Student IDs, you need to do a POST-PROCESSOR called Regular Expression Extractor.
It reads the source code and can store specific information into a variable name.
You then pass the variable into the View and Delete Calls.
Link: http://jmeter.apache.org/usermanual/component_reference.html#Regular_Expression_Extractor
Your Jmeter Script would look something like this:
--- Regular Expression to grab Student IDS