3

I have 50 records(rows) in my CSV file, and I have 10 thread groups which all depend on each other.

Example (I'm calling Thread Group TH):

TH1
|_some request
  |_fetching output value

TH2
|_request(passing TH1 output value here)
  |_fetching output

I wanted to run 1st record from CSV and continuously run from TH1 to TH10, then pick 2nd record from CSV and continuously run TH1 to TH10.

Right now my script is picking any record from CSV and running in ordered way of threads and requests.

I also wanted to store all output values from each thread somewhere (csv, txt, any variable).

Andrei Botalov
  • 20,686
  • 11
  • 89
  • 123
AutomationWorld
  • 75
  • 2
  • 10

1 Answers1

0

The easiest way to do it is via JMeter Plugins' Inter-Thread Communication.

Thread Group 1
  CSV Data Set Config
  Request
    // Fetching outputValue1 in PostProcessor
    Inter-Thread Communication PostProcessor (FIFO Queue=FIRST, Value to put=${outputValue1})
    // Storing outputValue1 somewhere
Thread Group 2
  Request
    Inter-Thread Communication PreProcessor (FIFO Queue=FIRST, Variable name=${inputValue2})
    // Fetching outputValue2 in PostProcessor
    Inter-Thread Communication PostProcessor (FIFO Queue=SECOND, Value to put=${outputValue2})
    // Storing outputValue2 somewhere
...
Thread Group 10
  Request
    Inter-Thread Communication PreProcessor (FIFO Queue=NINE, Variable name=${inputValue10})
    // Storing outputValue10 somewhere


Note that ${inputValueN} equals to ${outputValueN-1}.

There are some other ways to pass variable between threads. But I think that this one is the easiest.

Community
  • 1
  • 1
Andrei Botalov
  • 20,686
  • 11
  • 89
  • 123
  • HI,thanks for your reply but i didn't get what you are saying ${inputValueN} equals to ${outputValueN-1}.how would i say outvalue1 or 2...just am getting one value and assigning...like myvalue=${outputvalue}..am not passing any numbering,please clear my doubt. one more thing how i can control my CSV file to run 1 row to last row,i mean picj 1st record and run all threads then pick 2nd record and run all threada....like to run 10 records from CSV files,is there any way for it – AutomationWorld Oct 24 '12 at 12:25
  • Forgot to say,currently my script running all create request by picking all rows from CVS ,picking any record randamly once all the requests completed(TH1 having multiple request) then moving to the next thread but before moving to next thread i wanted to store all data with diff variables, or otherwiese i want to run 1st .2nd ..with all threads,u can see my previous post – AutomationWorld Oct 24 '12 at 12:36
  • @AutomationWorld ${inputValueN} equals to ${outputValueN-1} because of Inter-Thread Communication. – Andrei Botalov Oct 24 '12 at 19:26