Toad World® Forums

How can I setup common test data for all test cases?


#1

This was question was asked of me by a user:

How can I setup common test data for all test cases? I can do now test data setup for single case but how about all cases?? Should I edit the generated code?


#2

No, no, no!! Do not edit the generated code!

Instead, you can choose to define your setup logic at a higher level in the test hierarchy, either at the unit test level (which will then be run before any and all test cases are run) or at the test definition level (which will then be run before any and all unit tests are run). You will do this inside the Test Editor.

And if you need to run the same setup logic at the start of each test case - that is, you can’t run it ONCE before all the test cases, then at the unit test level you will create a custom subprogram in the section titled “Declarations of custom procedures and/or functions”.

Then in each test case initialization section, you call that program.

Let me know if you have trouble seeing how to do this in the Test Editor.

Regards, Steven