How to append todays timestamp in default created html report in robot framework
After execution robot framework create 3 files
log.html
output.xml
report.html
When we re-run it owerite the logs instead I want to create new log files by appending timestamp e.g. as below
log_2022_18_5.html
output.xml
report_2022_18_5.html
Where should be do code changes and how this can be achieved ?
I tried above command on windows as below -
robottestscript.robot -l log_%date:~-4,4%-%date:~-10,2%-%date:~-7,2
%.html -r report_%date:~-4,4%-%date:~-10,2%-%date:~-7,2%.html
[ ERROR ] Parsing ‘-l’ failed: File or directory to execute does not exist.
Also Tried -
robot testscript.robot -d ./%date:~-4,4%%date:~-10,2%%date:~-7,2%
[ ERROR ] Parsing ‘-d’ failed: File or directory to execute does not exist.
I tried above but main thing I have to call robot script vai agent runner where I am not using any command to run. I am just calling robot.run() from script directory.
I already tried this from script directory and not working
python -m robot test_script.robot
python -T robot test_script.robot
python -T robot test_script.robot -m
I am able to run script with simple command => robot test_script.robot but I want to add timestamp to be appended in generated html report file names.
currently its showing as log.html and report.html and overwriting same but it should be like below
e.g. report_2022_19_05.html or log_2022_19_05.html
Tried below command on windows , its running tests but not generated reports
python -m robot -l log_%date:~-4,4%-%date:~-10,2%-%date:~-7,2%.html -r report_%date:~-4,4%-%date:~-10,2%-%date:~-7,2%.html test_script.robot