Search code examples
automated-testsappiumrobotframework

How to set custom filename for pabot result (html)


I implemented test cases for my application and decided to run it everyday. The problem is the result of the previous test will be overwritten by the latest test result. I need to keep them both so I came up with a solution that include the test date and time in the report name, for example; report-202111181704.html (use time in 24-hour format).

I searched through the internet and did not found any solution yet. Anybody here know the solution? or any alternative solution will be fine.


Solution

  • I found the solution. Instead of setting .html file name, I create a folder and put the result there.

    To do this, add --outputdir in pabot command so it's gonna look like this

    pabot --pabotlibport $PABOT_PORT --pabotlib --resourcefile ./DeviceSet.dat --processes $thread --verbose --outputdir ./result/$OUTPUT_DIR $ENV

    where $OUTPUT_DIR=`date + "%Y%m%d-%H%M"`

    The output folder gonna be like ./result/20220301-2052