1

I need perform some requests in paralell, I saw jp@gc - Parallel HTTP Requests, but I can´t found a way to load dynamically the URL´s in to the controller; my problem is the URLs to hit come from a JSON response; What is the way to indicate the URLs in a variable? Exist any way to manipulate the sampler using a JSR232 or beanshell to include the URLs? Or maybe how can I do a Thread Group and a HTTP sampler in execution time?

Kind Regards,

Alejandro Longas H.

1 Answer 1

1

If you're looking for a code to add URLs to the Parallel HTTP Requests sampler in the JMeter runtime:

  1. Add setUp Thread Group to your Test Plan
  2. Add JSR223 Sampler to the setUp Thread Group
  3. Put the following code into "Script" area:

    SampleResult.setIgnore()
    def testTree = ctx.getEngine().test
    def parallelSamplerSearch = new org.apache.jorphan.collections.SearchByClass<>(com.blazemeter.jmeter.http.ParallelHTTPSampler.class)
    testTree.traverse(parallelSamplerSearch)
    def parallelSampler = parallelSamplerSearch.getSearchResults().first()
    parallelSampler.addURL('http://example.com')
    parallelSampler.addURL('http://jmeter.apache.org')
    
  4. That's it, now Parallel HTTP Request sampler should fire 2 requests to the above URLs simultaneously.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi Dmitri thanks, it works!, Exist a way to capture the response?
Hi @Dmitri T, I´m working with your recomendations, but I see only 6 six request performed in parallell, the others is executed with a 3 sec of delay, maybe could be something of configuration? Maybe could be a limitation in de jp@gc - Parallel HTTP Requests? I was reading the documentation and I don´t found nothing relate that; maybe you know? I need perform 96 request in parallel

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.