Use todays date as a variable in Jmeter

10,430

Solution 1

It is as simple as using JMeter __time function:

https://myserver01.net/alert/bydate/${__time(yyyy-MM-dd,)}

To test functions, you can use Function Helper Dialog which allows you to test:

Function Helper Dialog

Solution 2

  1. Add User Defined Variables configuration element somewhere to your Test Plan
  2. Add the following entry there:

    • Name: Today
    • Value: ${__groovy(new Date().format('yyyy-MM-dd'),)}
  3. Once done you will be able to refer today's date as ${Today} where required

More information:

Share:
10,430
nhrcpt
Author by

nhrcpt

QA Automation Engineer Area of expertise: Python, Java, JavaScript, Protractor, Robot Framework, Karma, NightwatchJS

Updated on June 14, 2022

Comments