How to run several test suite in a loop?

1,991 views
Skip to first unread message

Daniel Chen

unread,
Aug 24, 2011, 1:36:27 AM8/24/11
to robotframe...@googlegroups.com
Hi All,
I'm new to Robot Framework, but found it's very powerful.
Currently I have a question about how to run several test suites in a loop, could anyone help me?

Detail description:
1. I have several test suites, each of them contains some test cases.
2. Run all above mentioned test suites then passed the testing for one product.
3. Now I have more than one products, and because all of them need to perform same test suites, I want to put them in a even higher level of test suites, and trigger a "For" loop, test them one by one.

Does this possible?
If you have any questions please let me know.
Thanks all.

SMERSH009X

unread,
Aug 25, 2011, 1:41:50 PM8/25/11
to robotframe...@googlegroups.com
I'm sure there's an easier way to do it,
But I would just have Robot output some sort of a debug message in the log at the end of the test cycle like "test done."  I'd use a command to monitor the log, like in Unix "tail -f". And once "test done" message was spotted, it would automatically launch test #2.

Pekka Klärck

unread,
Aug 31, 2011, 3:26:47 AM8/31/11
to cho...@gmail.com, robotframe...@googlegroups.com
2011/8/24 Daniel Chen <cho...@gmail.com>:

> Hi All,
> I'm new to Robot Framework, but found it's very powerful.

Welcome aboard and sorry for slightly later reply to your question.

> Currently I have a question about how to run several test suites in a loop,
> could anyone help me?
>
> Detail description:
> 1. I have several test suites, each of them contains some test cases.
> 2. Run all above mentioned test suites then passed the testing for one
> product.
> 3. Now I have more than one products, and because all of them need to
> perform same test suites, I want to put them in a even higher level of test
> suites, and trigger a "For" loop, test them one by one.

This kind of looping is best done outside the framework. You can run
multiple separate test runs and then combine results with rebot. For
example something like this could work:

for product in product1 product2 product3; do
pybot --name $product --output $product.xml --log none --report
none path/to/tests
done
rebot --name All_tests_for_X *.xml


The above code is shell script but you could do similar things on
Windows using batch files. If this kind of start-up scripts grow
larger, it is often better to switch to Python or some other
programming language. For some more information and examples see the
User Guide:

http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.6.1#creating-start-up-scripts
http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.6.1#post-processing-outputs

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