2
votes

I have a scenario to test.Request 1(a SOAP/XML request) generates Response which has a field, say totaldocsperpage. Based on that field, the same Request 1 has to be run that many times as of the totaldocsperpage, with pagenum (a variable field in request 1) incrementing from 1 to totaldocsperpage.

How this can be achieved? I extracted the totaldocsperpage using Regex extractor and used a while controller in the beginning with the below condition

${__javaScript("${pagenum}" < "${totaldocsperpage}")}

with pagenum as the counter name I have given for incrementing page number in the Request 1.

I want this to run totaldocsperpage times and stop. But it just runs infinitely. Any help is much appreciated.

2

2 Answers

1
votes

If you comparing numbers in condition you don't need quotes, also use __jexl3 or __groovy instead of __javaScript

Checking this and using __jexl3 or __groovy function in Condition is advised for performances

${__jexl3(${pagenum} > ${totaldocsperpage})}
0
votes
  1. Remove quotation marks from your expression:

    ${__javaScript(${pagenum} < ${totaldocsperpage})}
    
  2. Check jmeter.log file for any suspicions entries
  3. It might be a better idea to go for XPath Extractor given you receive XML-based response