How to get and set the default output directory in Robot Framework(Ride) in Run time

6,972 views
Skip to first unread message

rafi pathan

unread,
Apr 20, 2016, 9:21:19 AM4/20/16
to robotframework-users
Hi All,

I want to get and store the robot framework results into separate directory/folder based on timestamp.

could you please help me to resolve this issue.

Thannks,
Rafikhan

Nesat Ufuk

unread,
Apr 20, 2016, 9:37:28 AM4/20/16
to robotframework-users

Michael Russell

unread,
Apr 20, 2016, 9:47:35 AM4/20/16
to rafi.p...@gmail.com, robotframework-users

Classification: //Dell SecureWorks/Confidential - Limited External Distribution:

If you just want unique filenames, you can use “-T” (you can see the doc for this by typing “pybot -h”).

 

If you really want a separate directory instead of just filenames, I think you’ll need to wrap the “pybot” call in some sort of script.

 

Michael Russell

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

rafi pathan

unread,
Apr 20, 2016, 9:50:27 AM4/20/16
to robotframework-users, rafi.p...@gmail.com
Hello Michael ,

My requirement is to generate separate folder for each test run.

can you please provide the piece of code in python :

Eg: I want to generate log results  in C:\Results\Timestamp_Logs for each run it will create log folder in C:\Results\ directory.


On Wednesday, April 20, 2016 at 7:17:35 PM UTC+5:30, Em Arr wrote:

Classification: //Dell SecureWorks/Confidential - Limited External Distribution:

If you just want unique filenames, you can use “-T” (you can see the doc for this by typing “pybot -h”).

 

If you really want a separate directory instead of just filenames, I think you’ll need to wrap the “pybot” call in some sort of script.

 

Michael Russell

 

From: robotframe...@googlegroups.com [mailto:robotframe...@googlegroups.com] On Behalf Of rafi pathan
Sent: Wednesday, April 20, 2016 9:21 AM
To: robotframework-users <robotframe...@googlegroups.com>
Subject: How to get and set the default output directory in Robot Framework(Ride) in Run time

 

Hi All,

 

I want to get and store the robot framework results into separate directory/folder based on timestamp.

 

could you please help me to resolve this issue.

 

Thannks,

Rafikhan

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotfram...@googlegroups.com.

Pekka Klärck

unread,
Apr 20, 2016, 4:08:39 PM4/20/16
to rafi.p...@gmail.com, robotframework-users
2016-04-20 16:50 GMT+03:00 rafi pathan <rafi.p...@gmail.com>:
>
> My requirement is to generate separate folder for each test run.
>
> can you please provide the piece of code in python :

As Michael commented, this is easiest to accomplish by having a
wrapper script that runs your tests instead of using robot/pybot
command directly. Such a wrapper script can be implemented using any
language, for example, as a shell script:

#!/bin/bash
timestamp=`date +%Y%m%d-%H%M%S`
robot --outputdir $timestamp "$@"

If you use Python, you can start execution programmatically:

#!/usr/bin/env python

import sys
import time
import robot

timestamp = time.strftime('%Y%m%d-%H%M%S')
robot.run_cli(['--outputdir', timestamp] + sys.argv[1:])


Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org
Reply all
Reply to author
Forward
0 new messages