How do i generate the results CSV ,jtl files automatically with the date and time format?
Basically what i am trying to looking for generating the Test results files CSV and jtl files automatically with the date and time stamp and pass that results file in the Graphs Generator , so that I don't need to keep modify the jmx files.If possible Graphs output folder also with the date and time stamp.
How do I achieve this?
please see the below screenshots
2017/04/05 16:07:49 INFO - jmeter.engine.StandardJMeterEngine: Running the test!
2017/04/05 16:07:49 INFO - jmeter.samplers.SampleEvent: List of sample_variables: []
2017/04/05 16:07:49 ERROR - jmeter.engine.PreCompiler: invalid variables org.apache.jmeter.functions.InvalidVariableException: Expected } after __time function call in C:\JMETER\LR2JMeter\NGP\Results\NGP_PensionReport\PR_ViewResultsTable_${__time(YMDHS),}.csv at org.apache.jmeter.engine.util.FunctionParser.makeFunction(FunctionParser.java:139) at org.apache.jmeter.engine.util.FunctionParser.compileString(FunctionParser.java:82) at org.apache.jmeter.engine.util.CompoundVariable.setParameters(CompoundVariable.java:189) at org.apache.jmeter.engine.util.ReplaceStringWithFunctions.transformValue(ReplaceStringWithFunctions.java:46) at org.apache.jmeter.engine.util.ValueReplacer.replaceValues(ValueReplacer.java:170) at org.apache.jmeter.engine.util.ValueReplacer.replaceValues(ValueReplacer.java:80) at org.apache.jmeter.engine.PreCompiler.addNode(PreCompiler.java:78) at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:996) at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:997) at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:978) at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:306) at java.lang.Thread.run(Unknown Source)
Please advise me!
Thanks, Rajani
Results can be read from XML or CSV format files. When reading from CSV results files, the header (if present) is used to determine which fields were saved. In order to interpret a header-less CSV file correctly, the appropriate JMeter properties must be set.
__time() function in JMeter This function is used to generate the current timestamp in different formats. __time() has two arguments i.e. Time Format and Name of Variable and both are optional. __time() function without any argument returns the current time in epoch format.
By default, JMeter saves the test results in csv format without storing the response data.
Solution: JMeter function time() generates timestamp in epoch format in millisecond i.e. 13 digits numbers like 1559815879767. Sometimes there is a requirement to pass the current timestamp in second i.e. 10 digits numbers like 1559815879.
Use below syntax to name your file. You can use this cheat sheet, if you want to change the format.
For more details about functions, please check this link.
${__time(MM-dd-yyyy-HH-mm-ss,)}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With