Reputation: 7
I have the following response: -rw-r----- 1 www-data www-data 38269320 May 12 03:13 17003156.xml
And I want to create the response assertion that will check that there is current month and current date in the response (May 12). If I am using ${__time(MMM d,)} function for that, I am getting the following assertion error:
Assertion failure message: Test failed: text expected to contain /maijs 12
How is possible to set names of the months in English (like May) ?
If I am using ${__time(MMM d,)} function for that, I am getting name of the month in custom language.
Upvotes: 0
Views: 86
Reputation: 168092
__time() function will return month name in your current locale.
The options are in:
Amend user.language
and user.country
and user.variant
system properties to the locale used by the system under test
or switch to __groovy() function where you can specify which Locale to use for returning the month name:
${__groovy(java.time.ZonedDateTime.now().getMonth().getDisplayName(java.time.format.TextStyle.FULL\,Locale.ENGLISH),)}
More information on Groovy scripting in JMeter: Apache Groovy: What Is Groovy Used For?
Upvotes: 0