Specifying the start date / time of a test suite?

We are starting with regression testing by using RF. The repeating test results should then be put together to see the historical development of the project (with allure or robotframework-dashboard). As we are not starting from scratch, we also have a bunch on historical test data setups. To bring them into the historical timeline I want to run the tests now but need to backdate those test results back to when the dataset was generated.

I have not found any reference or option to do so. Is there any way to specify the start date / time of the tests, when running them?

Thanks, Christian

Hi Christian,

Welcome to the forum :+1:

Do you still have the output.xml files from those previous runs? If you do there might not be any need to rerun and backdate the results.

Depending how you plan to import the data into the reporting system, it might be as simple are running [rebot](Robot Framework User Guide) (part of robot framework) to generate the data for the imports.
rebot command arguments are basicity the same as robot but the difference is rebot doesn’t actually re-run the tests, it simply reruns the reporting generation from the output.xml file(s) of a previous run(s). Most commonly rebot is used for combining logs from several runs into a single report file, but it can also be used for re-enumerating the html files, etc.

Hope that’s helpful,

Dave.

1 Like

Hi Dave,

thanks a lot for the quick reply. Up to now I just have read about rebot WRT partial test reruns. I will have a deeper look into what is possible here.

Thanks,
Christian

1 Like

Hi Dave,

I have given it a try to use rebot but it was not working as expected. I used the –starttime option to change the start timestamp. This was working fine but as the end time was not modified, the (by 2 months) backdated test was now running for many days. Changing the end time requires a more tricky calculation then. In addition, it seems that the report-dashboard is also using a different timestamp (looks like it uses the one from the <robot generator> to add the reports to the timeline, so that the change had no effect.

For now I’m living with a dump solution. I’m replacing the date portion of the <robot generator= and <status … start= tags directly in the output.xml` This keeps the runtime calculation intact and the tests results (for the reruns of some planning results from older reference data) are now correctly added into the timeline.

Thanks for your support,
Christian

1 Like

I’m glad you found a solution :+1:

I was more suggesting that you didn’t need to modify the times if you have the original output.xml files from when the tests were run, sorry if I wasn’t clear on that.

if you want to modify an entire run from a recent log but have it report the old date based on the start time of that old run, then modifying the output.xml file is probably the only option, I don’t think Robot has tools for doing this, it’s not something people would normally do.

I’d probably use python to do this, open the xml with the elementree module, locate the element with the start time, use the datetime module to parse the start time to a date object, then with that calculate the time delta from the start time you wanted, then iterate over the rest of the elements in the xml and apply that time delta to their times and finally save the xml to a new output_changed.xmlbut you could probably use XML Library and robot framework to do this if you wanted.

Dave.

2 Likes