Choosing id one by one from a variable in jmeter

202 views Asked by At

I want to delete mappings in DB using DataService. For this purpose

  1. I run search query for all ids in first thread group.
  2. Using this method I put my Ids into the property. Now property has view like that b69243ee6e9efdf66114200dc93881ac,b69243ee6e9efdf66114200dc90f5ba4,b69243ee6e9efdf66114200dc90e2184

  3. I want to all delete mapping using this Ids from property one by one. For this purpose I need run BeanShell Pre-Processor and choose first id and put it into variable. Please, help me with this script.

1

There are 1 answers

0
Edi Prayitno On

I believe ForEach Controller is the solution. But in my experience, I use regular expression extractor to grab the values and put it in one variable then loop it using ForEach Controller. I think these step will help you:

  1. Add Regular Expression Extractor to grab the ids. Make sure you fill field "Match No" with negative number (i.e. -1). Put the extracted value into one variable (i.e. IdVar. Fill Reference Name with IdVar). This step will grab all matched ids and put it into IdVar variable.
  2. Then Add ForEach Controller to process each ids from IdVar variable.

For the details, just download this sample and try to run it.

I hope this will help you. :-)