jmeterload-testingbeanshell

SetProperty in BeanShell Post Processor


I have two thread groups in my test-plan. First screen - I put "id" in variable "spaceId" (using JSON Extractor). enter image description here Second screen - I use SetProperty in BeanShell PostProcessorenter image description here In log I see that "spaceId" has value of my "id"enter image description here But in API of second thread group value "space" is not getting my "id" code, it is null enter image description here Can you say me where I have a mistake

Screenshots in block


Solution

  • You need to use __P() function to get the value of a JMeter Property, to wit change ${spaceIdNew} to ${__P(spaceIdNew,)}

    In general using Beanshell is some form of a performance anti-pattern, since JMeter 3.1 it's recommended to use JSR223 Test Elements and Groovy language for scripting. See Beanshell vs. JSR223 vs. Java For JMeter: Complete Showdown article for more details.