JMeter正则表达式提取器,用于每个控制器 [英] JMeter regex extractor forEach controller

查看:202
本文介绍了JMeter正则表达式提取器,用于每个控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用JMeter创建一些测试,情况非常简单,我有一个包含结果列表的搜索页面,并且我必须从该结果中检索一些值以用于下一个请求. 这些结果大约是350,我不需要全部.

I'm creating some tests with JMeter, the situation is very simple, I have a search page with a list of results, and I have to retrieve from this results some values to use in the next request. Those results are around 350, I don't need them all.

我使用RegexExtractor检索了这些结果,并且它可以工作(我将其设置为仅检索10个结果),但是现在我不知道如何在LoopCounter中访问结果. 提取程序将结果放入名为Result的变量中.

I used the RegexExtractor to retrieve those results and it works (I setted it to retrieve just 10 results), but now I don't know how to access the results inside a LoopCounter. The extractor put the results into a variable named Result.

问题是我不知道如何动态地建立变量名. 我必须使用_p()之类的函数吗? 我只需输入静态名称​​ Result_0_g1

The problem is that I don't know hot to build dinamically the name of a variable. Do I have to use some function like _p()?? I can access the variable just putting the static name Result_0_g1

在LoopCounter中,我还放置了一个计数器,用于将循环计数存储到变量 index

Inside the LoopCounter I putted also a Counter to store the loop count into the variable index

谢谢

解决了,我必须写:

$ {__ V(Result _ $ {index} _g1)

${__V(Result_${index}_g1)

推荐答案

您必须使用以下函数引用该变量:

You have to reference the variable with the function:

${__V(Result_${index}_g1)

这篇关于JMeter正则表达式提取器,用于每个控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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