Is there a way to get Robot Framework to run test suites in a certain order?

If there are multiple test case files in an RF directory , the execution order can be specified by giving numbers as prefixes to test case names , like this.

01__my_suite.html -> My Suite 02__another_suite.html -> Another Suite

Such prefixes are not included in the generated test suite name if they are separated from the base name of the suite with two underscores:

More details are here.

http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#execution-order


You can use tagging.

Tag the tests as foo and bar so you can run each test separately:

pybot -i foo tests

or

pybot -i bar tests

and decide the order

pybot -i bar tests || pybot -i foo tests

or in a script.

The drawback is that you have to run the setup for each test.


Robot framework can use argument files that can be used to specify order of execution (docs):

This is from older docs (not online anymore):

Another important usage for argument files is specifying input files or directories in certain order. This can be very useful if the alphabetical default execution order is not suitable:

Basically, you create something similar to start up script.

--name My Example Tests
tests/some_tests.html
tests/second.html
tests/more/tests.html
tests/more/another.html
tests/even_more_tests.html

There is neat feature that from argument file you can call another argument file that can override previously set parameters. Execution is recursive, so you can nest as many argument files as you need

Another option would be to use start up script. Than you have to deal with other aspects like which operating system you are running test on. You could also use python for starting up script on multiple platforms. There is more in this section of docs