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 3481888
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:29:49+00:00 2026-05-18T10:29:49+00:00

Using jmeter, I have a variable passed from CSV file (using CSV Data Set

  • 0

Using jmeter, I have a variable passed from CSV file (using CSV Data Set Config), and I’d like to use a substring of it in an http request.

i.e.
variable TIME=23:40, request paramaters are hour and minute, so I want to extract appropriate parts, in the HTTP Request.

I read you could use javascript, so for the hour, I tried ${TIME}.substring(0,2) , which didn’t look as though it would work, and sure enough it didn’t.

How do I do this?

  • 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-05-18T10:29:50+00:00Added an answer on May 18, 2026 at 10:29 am

    You can do that by calling javascript function inline http://jmeter.apache.org/usermanual/functions.html

    Ex :

    ${__javaScript('${TIME}'.substring(0\,2))}
    

    Or

    1. create user defined variables sample
    2. create variable called myTime(or anything you want)
    3. create beanshell sampler, choose beanshell as language in it then:

      String tempTime = vars.get("myTime");
      String newTime = tempTime.substring(0,2);     
      vars.put("newTime", newTime);
      

    use ${newTime} variable in your request

    Edited according to the other answer. Comma needs to be quoted.

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

Sidebar

Related Questions

Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I am using JMeter and have 2 questions (I have read the FAQ +
Using Core Data. Let's say we have models for Team and Player. Assume: -Each
Using a site like StackOverflow as an example: I have a table of users,
Using PHP I'm attempting to take an HTML string passed from a WYSIWYG editor
I am attempting to pull some information from my tnsnames file using regex. I
I am looking to load test a consumer website. I have tried using JMeter.
We are using JMeter in a heterogeneous environment and we would like to measure
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using online interfaces to a version control system is a nice way to have

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.