Importing test case files

680 views
Skip to first unread message

Jens Deppe

unread,
Jan 23, 2013, 1:39:56 PM1/23/13
to robotframe...@googlegroups.com
Hi,

Is it possible to import test case files?

I'm developing a test harness to test deployment of various webapps to different web app containers. The tests I want to run are all the same, however the setup for each container is different.

I'm finding that my test cases are just a cut-n-paste between the various test files I have - one for each different setup I'm doing.

I imagine something like this:

| *Setting* |
...
| *Keyword* |
...
| *Test Case*     | *Action* | *Argument* |
|                        | [import] | common_tests.txt |

--Jens

Pekka Klärck

unread,
Jan 24, 2013, 4:20:04 PM1/24/13
to jens....@gmail.com, robotframe...@googlegroups.com
2013/1/23 Jens Deppe <jens....@gmail.com>:
> Hi,
>
> Is it possible to import test case files?

Short answer: no.
Exactly this isn't possible, but you can easily get the same
functionality done by the same tests multiple times with different
variables. Your setups and teardowns can be specified as variables so
simply by using different variables from the command line the same
tests will behave differently. With web tests variables are also often
used for controlling which browser to use.

After running the tests, you can then at the end combine results
together with Rebot. In practice you could have something like this in
a shell script or a batch file:

pybot --variable BROWSER:Firefox --variable SETUP:XXX --log NONE
--report NONE --output Firefox-XXX.xml --name Firefox_XXX tests/
pybot --variable BROWSER:Firefox --variable SETUP:YYY --log NONE
--report NONE --output Firefox-YYY.xml --name Firefox_YYY tests/
pybot --variable BROWSER:IE --variable SETUP:XXX --log NONE --report
NONE --output IE-XXX.xml --name IE_XXX tests/
pybot --variable BROWSER:IE --variable SETUP:YYY --log NONE --report
NONE --output IE-YYY.xml --name IE_YYY tests/
rebot --name My_Tests *.xml

If you really want to use Robot for controlling test execution, you
could obviously run these tests with Robot using OperatingSystem
library. Most likely that would be more complicated than using a
simple batch file or shell script, though.

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