使用 JDBC 请求返回的表中的所有行

问题描述

我使用 JDBC 请求来选择登录到应用程序的用户。结果正确返回,但我注意到 HTTP Sampler 仅使用表中的第一个结果。 我也使用 ForEach Controller 来避免因此获得列名,但不认为它与问题有关。

enter image description here

该表包含一些结果,我想在每次新登录时一一使用它们。

enter image description here

解决方法

您是否在 JDBC 请求采样器下定义了“变量名”?应该这样做:

enter image description here

这样你会得到以下JMeter Variables

businessId_#=number of rows 
businessId_1=value from 1st row
businessId_2=value frmo 2nd row

这样你就可以使用 ForEach Controller 迭代它们

更多信息: