Copying a log.html to another folder

Hi All ,

Can someone please suggest on how do we copy a log.html file to a folder

Thanks in advance!!!

That previous response was incomplete. It was supposed to be something like

--log /full/path/to/folder/my_log_file_name.html
2 Likes

Hi Shruti,

Tessa’s (@tessatriolo) reply is the best option, though not exactly what you asked, it’s simply telling robot where to put the log files, not copying them. this is the best way.

if you really want to make a copy of the log.html as in have it created in the normal place but also make a copy to another location as well then you’ll need to do this outside robot framework as the file only gets generated after the teardowns are all finished so the file won’t exist when a keyword tries to copy it.

Hope that helps,

Dave.

1 Like

Hi Dave ,

Thank you for the suggestion .

In the teardown step I am trying to copy the file .But while copying the log file to another location, screenshots are not visible as I think the screenshot path references get deferred .

If we save log.html file and then copy, all the screenshots are visible once we open the file. Hence would need suggestion on how to save the log.html file .

Thanks

Hi Shruti,

Yes as I mentioned the html files don’t exist during teardown, only output.xml does but it’s not a complete file during teardown so if you copied it then you’d get a corrupt file (someone else on this forum already tried)

You need to wait for robot to exit then copy the files using os level scripting (i.e. .bat on Windows or .sh on *nix/Mac)

As for the screenshots, they are usually .png files in the same folder as output.xml and the html files, so you can copy them with a *.png pattern match.

Dave.

Sure, would try with os level scripting .

Thank you.