How to make use of a Data Driven script in Robot Framework

6,470 views
Skip to first unread message

eilser

unread,
Jun 22, 2010, 9:47:31 PM6/22/10
to robotframework-users
Hi,

I would like to seek some help on "How to create/write a .csv files
that contains test data that will be used in the scripts. What is the
structure of the file."

Pekka Klärck

unread,
Jun 23, 2010, 12:42:44 PM6/23/10
to reslie...@gmail.com, robotframework-users
2010/6/23 eilser <reslie...@gmail.com>:

>
> I would like to seek some help on "How to create/write a .csv files
> that contains test data that will be used in the scripts. What is the
> structure of the file."

Does it necessarily need to be a separate CSV file? Robot Framework
supports data-driven style directly as explained in the User Guide
[1]. External files might be a good idea if you already have the data
in these files for some other purpose. In that case I would use
variables files [2] to parse the data and make it available in test
cases.

[1] http://robotframework.googlecode.com/svn/tags/robotframework-2.5/doc/userguide/RobotFrameworkUserGuide.html#different-test-case-styles
[2] http://robotframework.googlecode.com/svn/tags/robotframework-2.5/doc/userguide/RobotFrameworkUserGuide.html#variable-files

Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

SMERSH009X

unread,
May 31, 2011, 2:14:55 AM5/31/11
to robotframe...@googlegroups.com, reslie...@gmail.com
There is a really easy approach outlined in http://www.virtuousprogrammer.com/?p=264  check out the section  called Data Driven Tests.  It helped get me up and running pretty quickly.

Gaurav Deore

unread,
Nov 8, 2012, 11:33:20 PM11/8/12
to robotframe...@googlegroups.com, reslie...@gmail.com, robotframe...@googlegroups.com
Yes, Use of external file in automation is basic need. To get the test data from CSV or Excel file is easy way while doing testing so I wish with Robot framework automation it should have supported. 

This is another way to use Robot Framework more effectively in Web automation testing.

Thanks,
Gaurav Deore.

Prashant

unread,
Nov 9, 2012, 7:17:23 AM11/9/12
to robotframe...@googlegroups.com, reslie...@gmail.com

Chris Prinos

unread,
Nov 12, 2012, 10:13:44 AM11/12/12
to robotframe...@googlegroups.com, reslie...@gmail.com
If you use restructuredtext format for the robot source files, you can used the 'csv-table' directive to include external csv files.

chris
Reply all
Reply to author
Forward
0 new messages