jmeter - How to change the date format of the correlated date? -


i'm capturing date in 1 request can send captured date parameter next request. in next request date should sent different format. in order send date need modify date format how can that?

for example, if have ${date} variable value of 27/01/16 , need convert january 27, 2016

  1. add beanshell preprocessor child of 2nd request
  2. put following code preprocessor's "script" area:

    import java.text.simpledateformat;   simpledateformat source = new simpledateformat("dd/mm/yy"); simpledateformat target = new simpledateformat("mmmm dd, yyyy"); date date = source.parse(vars.get("date")); string newdate = target.format(date); vars.put("date", newdate); 

    after above code execution ${date} variable hold new value date in different format

see:


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -