I have a K6 test that is running multiple scenarios. I would like to export the test summary to Elastic and as part of it, would like to include the start and end times for the test run. I am trying to set these values inside my default function but then the values don’t stick when i get to the handleSummary() method.
`let startTime;
export default function () {
.. all scenarios and at the end i have a check
if (!startTime){
startTime = exec.scenario.startTime;
}
}`
export async function handleSummary(data) { console.log("Start Time", startTime); }
The startTime is undefined inside my handleSummary method. Has anyone tried this before? Is there a better/easier way to get this info in the summary method?
Thank you in advance!