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

  • SEARCH
  • Home
  • 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 8202643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:15:27+00:00 2026-06-07T07:15:27+00:00

I have a BSF post-processor added to a sampler. The script in the post-processor

  • 0

I have a BSF post-processor added to a sampler.
The script in the post-processor is:

var array = JSON.parse(prev.getResponseDataAsString());

array.forEach(function(object)
{
  OUT.println("patient_id: "+object.patientId);
  OUT.println("fname: "+object.fname);
  OUT.println("lname: "+object.lname);
});

now i want to use object.patientId, object.fname, object.lname values as parameters in another request’s parameters.

E.g.

Thread Group
- Sampler1
    BSF Post-Processor
- Sampler2

I want to use the variables in the BSF Post Processor’s javascript of Sampler1 as parameters in Sampler2. Is that possible?

  • 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-07T07:15:30+00:00Added an answer on June 7, 2026 at 7:15 am

    Easily: BSF PostProcessor provides read/write access to Jmeter Variables / Properties:

    vars – ( JMeterVariables) – gives read/write access to variables:
    vars.get(key); vars.put(key,val); vars.putObject(“OBJ1”,new Object());
    vars.getObject(“OBJ2”);

    props – (JMeterProperties – class java.util.Properties) – e.g.
    props.get(“START.HMS”); props.put(“PROP1″,”1234”);

    In the simplest case you can use

    vars.put(patientId,object.patientId.toString());
    vars.put(fName,object.fname.toString());
    vars.put(lName,object.lname.toString());
    

    in your BSF PostProcessor to set the variables, and then get they values like

    vars.get("patientId")
    

    or

    ${patientId}
    

    But since you are extracting ALL the records in foreach loop at once you cannot use this way.

    In this case you have to better use something like the following: write all the records values extracted in foreach loop into csv-file, and then use e.g. CSV Data Set Config to read records one-by-one in loop and use values along with your Sampler2:

    While Controller
        CSV Data Set Config
        Sampler 2
    

    …As well, if I find another, better way, I’ll be glad to know about it.

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

Sidebar

Related Questions

In my jmeter test, I have a BSF PreProcessor step (using groovy) running before
Have a painfully simple blog Post creator, and I'm trying to check if the
**Have it working now. I forgot to populate the Array List. How embarrassing. I'm
have anyone can tell me what syntax error on this actionscript (actionscript3.0)? var rotY:
Have added the following code to my SQL query: (Note cut down version) DECLARE
Have some code: using (var ctx = new testDataContext()) { var options = new
I have this code <tbody> <form action=dsf.php method=post> <?PHP if(mysql_num_rows($leerdb) > 0) {while ($rs
have a php code like this,going to convert it in to C#. function isValid($n){
have an an array String classname[]={'a','b','c','d'}; ArrayAdapter<CharSequence> adapterClasses = new ArrayAdapter<CharSequence>( getApplicationContext(), R.layout.spinner_item_class, R.id.spinnerclasstxt,
Have a question about calling one prototype function in another prototype function. for instance

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.