When is SETUP section executed?

Ask general questions here.
aterrong
Posts: 6
Joined: Thu May 26, 2016 11:43 am

When is SETUP section executed?

Post by aterrong » Tue Dec 13, 2016 5:18 pm

Hi all,
I usually create my TestSuite with this structure:

TestSuite
- Setup
- TestCase1
- TestCase2
...
- TestCaseN

If I run the entire suite setup is executed.

But if I run separate TestCases individually it's NOT executed.

Is there any way I can make sure that setup is run before EVERY TestCase (e.g. as the setUp() method in JUnit)

Thanks.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: When is SETUP section executed?

Post by krstcs » Tue Dec 13, 2016 5:43 pm

The SETUP/TEARDOWN section for the suite is ONLY run when the suite is run.

However, there are SETUP/TEARDOWN sections for EACH TEST CASE as well. You could put your setup modules in those sections if you want them run when the test case is run without the suite.
Shortcuts usually aren't...