2

What I'm trying to do is pass variable between the threads in JMeter - so one thread modify this value and next one will get it - please look at this structure:

Test Plan
    User Defined Variables
    Thread Group 1
        BSF PreProcessor
    Thread Group 2
        HTTP Request
  1. User Defined Variables:

    Name:  myvar
    Value: foo
    
  2. Thread Group 1 -> BSF PreProcessor:

    Script: vars.put("myvar","users");

  3. Thread Group 2 -> HTTP Request:

    Path: /api/${myvar}

What I've got from Thread Group 2 step - variable myvar with default value:

${myvar} == foo

but I want to persist value assigned to variable myvar in Thread Group 1 step so in Thread Group 2 I will get:

${myvar} == users
Aliaksandr Belik
  • 12,725
  • 6
  • 64
  • 90
pbaranski
  • 22,778
  • 19
  • 100
  • 117

1 Answers1

1

You can try this :

Also check :

Community
  • 1
  • 1
UBIK LOAD PACK
  • 33,980
  • 5
  • 71
  • 116
  • I'm currently added jmeter-plugins so following your answer I used Thread Communication Processors and that solved my problem Thanks. – pbaranski May 17 '13 at 11:16
  • I'm having a different problem where user defined variables are messed up between thread groups: ThreadGroup_1 picks up user defined variables from ThreadGroup_2, and vice versa – TiredOfProgramming Jul 30 '18 at 17:48