Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7743871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:38:46+00:00 2026-06-01T09:38:46+00:00

I have jmeter flow like this: ThreadGroup –Sampler to get the number of items

  • 0

I have jmeter flow like this:

ThreadGroup
--Sampler to get the number of items and store to vars("numItem",XYZ)
--LoopController on $numItem
-----Sampler to get number of subItem and store to vars("numSubitem", ABC)
-----LoopController on $numSubitem
-----LoopCounter
-----Sampler: print out the current counter from loopCounter

For example, the number of item = 2 and subItem = 10, my loopCounter print out will be 0 – 19. I have checked the checkbout “Track counter independently for each user” but it doesn’t affect because this is the same thread. Is there a way to make the counter count 0 – 9 and then 0 – 9.

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:38:47+00:00Added an answer on June 1, 2026 at 9:38 am

    In your example you can define additional var maxCount = subItem - 1 and set it as value of “Maximum” field for “Counter” instance, as shown below:

    In sampler where numSubitem is set (before 2nd loop):

    int numSubitem = 10;
    int maxCounter = numSubitem - 1;
    vars.put("numSubitem",Integer.toString(numSubitem));
    vars.put("maxCounter",Integer.toString(maxCounter));
    

    I’ve used Beanshell Sampler for test, you can use Beanshell Postprocessor, e.g.

    In Counter instance:

    enter image description here

    So counter will iterate as in your description.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to create a test application on JMeter where i need to get
We have a chunk of code something like this // semi-pseudo code def result
I am using JMeter and have 2 questions (I have read the FAQ +
In my jmeter test, I have a BSF PreProcessor step (using groovy) running before
I am just two days old in using JMeter . I have been asked
Have a look at this picture alt text http://www.abbeylegal.com/downloads/2009-04-01/web%20part%20top%20line.jpg Does anyone know what css
Is there a way to modularize JMeter tests. I have recorded several use cases
I have been using JMeter in GUI mode for composing all the test cases
I have trouble using SSL pages with JMeter, which I previously posted here .
I have following data in XML response in JMeter: <details> <srNo>1</srNo> <key>123</key> <Name>Inspector</piName> <age>89</age>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.