# Change output files if test fails

**URL:** <https://forum.robotframework.org/t/change-output-files-if-test-fails/2521>\
**Category:** Robot Framework\
**Created:** [4 October 2021 08:51 UTC](https://forum.robotframework.org/t/change-output-files-if-test-fails/2521 "2021-10-04T08:51:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackowski](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@jackowski](https://forum.robotframework.org/u/jackowski)\
**Post date:** [4 October 2021 08:51 UTC](https://forum.robotframework.org/t/change-output-files-if-test-fails/2521/1 "2021-10-04T08:51:04Z")

</div>

Hello,  
Is it possible to change output filenames (report.html, log.html, output.xml) not by command line parameters, but from inside the\*.robot file?

I want to save reports only if test fails. I would like to change output filenames in the “Test Teardown” keyword, in the _ **Settings** _ section.

---

<div class="post-metadata">

**Author:** ![aaltat](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/aaltat/32/15_2.png) [@aaltat](https://forum.robotframework.org/u/aaltat)\
**Post date:** [4 October 2021 10:37 UTC](https://forum.robotframework.org/t/change-output-files-if-test-fails/2521/2 "2021-10-04T10:37:14Z")

</div>

No, it is not possible to change the filename during test execution.
