as per the documentation i am passing this command to set the name of test result -testResultName abc-$Date{yyyy-MM-dd_HH.mm}. But the date is not coming in the test results
It's a jenkins variable, nothing to do with Neoload, the format of mine is $Date{hh:mm - dd MMM yyyy}, maybe your format doesn't exist?
What do you have instead of the date? Do you still see the $Date.... command?
Do you use the NeoLoad plugin to run your test or just the command line option?
For the latter you may have to add a backslash prior to the date command like this: \$Date
I am passing -testResultName "abc-\$Date{hh:mm - dd MMM yyyy}" in the output it is
abc-hh:mm - dd MMM yyyy
I am not using plugin.Using only command line
Hi,
Any update on my above comment
Do I need to import any package for Date
There's no package to install. On Linux -testResultName "abc-\$Date{yyyy-MM-dd_HH.mm}" should work and on Windows -testResultName "abc-$Date{yyyy-MM-dd_HH.mm}"
Do you put your value between double quote as above? What is your exact command line?
My command line is sh '/opt/neoload/bin/NeoLoadCmd -project "${WORKSPACE}/<project name>.nlp" -launch "scenario1" -testResultName "abc-\$Date{yyyy-MM-dd_HH.mm}" -NTS "<url>" -NTSLogin <NTS confg> -exit -noGUI -loadGenerators "${WORKSPACE}/neoload.yaml" -nlweb -nlwebAPIURL <nl web config> -exitCodeFailIgnore'
If you run that command by replacing the Workspace variable by its value do you get the correct date in the description of your test result?
No its still the same.. I am not getting the date
I will try this, report back soon
I was not able to reproduce that issue. Also i was not precise enough in my last comment. Have you run your command in a linux console outside of Jenkins?
When i run the same type of command on my case the test description gets the current date as expected.
I am running this code in jenkins pipeline
Okay, so it looks like $Date{} is not a jenkins variable, more like when Neoload reads it in and sees this, it knows to drop a date in, but I'm guessing here. This does work though (https://support.cloudbees.com/hc/en-us/articles/226504048...).
My command works, this
def dateFormat = new SimpleDateFormat("yyyyMMddHHmm")
sh 'NeoLoadCmd ... -testResultName "Pipeline Scenario '+ dateFormat.format(new Date()) +' (build ${BUILD_NUMBER})"
generates this -testResultName Pipeline Scenario 201904100944 (build 82)
Neil answered
Sadasivuni answered
Nouredine answered
Neil answered
Sadasivuni answered
Nouredine answered
Sadasivuni answered
Nouredine answered
Sadasivuni answered
Sadasivuni answered
Nouredine was made best respondent
Sadasivuni answered
Nouredine answered
Neil answered
Sadasivuni posted a new question