0

i need 5 requests like belowe mentioned screenshotgot only one request in view results tree needed 5 requests as mentioned in while controller code i need 5 requests as like in l'st screenshot by using code without error pls suggest

I got only one request in view results tree needed 5 requests as mentioned in while controller code in 2 nd screenshot

1

I think your script works as expected and it stops due to 1st clause is being met, to wit ${titleresponse} variable value becomes Top 17 Appium Interview Questions so JMeter exists the loop.

If you don't like the error in the log you can amend the second part of your condition to look like "${counter_value}" != "5"

Full condition just in case:

${__javaScript(("${titleresponse}".indexOf("Top 17 Appium Interview Questions") == -1 && "${counter_value}" != "5"),)}

Also be aware that starting from JMeter 3.1 it's recommended to use JSR223 Test Elements and Groovy language or __groovy() function for scripting so you might want to convert your expression to something like:

${__groovy(!vars.get('titleresponse').equals('Top 17 Appium Interview Questions') && !vars.get('counter_value').equals('5'),)}

More information: Apache Groovy - Why and How You Should Use It

  • Tq for ur guidence but am getting only one http reqst .As mentioned in while controller "5" it should come 5 http request after applying ur code am getting one request withut error need 5 requests. pls suggest@Dmitri – Guruganesh Dec 10 '18 at 5:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.