Search code examples
automationrobotframework

Robot framework: Differences between suite setup and test setup?


I'm new to robot framework. Could any one explain to me the differences between suite setup and test setup? When to use? Examples...

Thank you in advance.


Solution

  • In the simplest terms possible, a suite setup runs exactly once at the start of a suite. A test setup runs at the start of a test case.

    If you define a test setup in the settings section of the suite, it will run at the start of each test in the suite (ie: if you have 5 tests, it will run five times). If you define it in a specific test, it will only run for that test where it is defined.

    A suite setup is a good place to do some initialization, such as starting a server, opening a browser, making a database connection, etc.

    A test setup is a good place to do some work unique to the test that isn't actually part of the verification. For example, you might use the test setup to log in and navigate to the page being tested.