Forum Discussion

jkrier's avatar
jkrier
Regular Contributor
8 years ago

How to loop Test Suites or Test Cases

I have a Project that is currently built as Project Test Suite Test Case Test Steps   I have many Test Steps at the top that run queries and get log in credentials and then the remaining Test S...
  • Radford's avatar
    8 years ago

    I think you are correct when you say "individual method Test Steps to be their own Test Case", I've always approached things assuming that a test case should be a self contained unit that can be run independently, testing one specific thing.

     

    When faced with an issue like yours, I've always created a "Common Library" Test Suite, where I create all of my reusable "common" test cases, and then in my actual test cases, use the Run TestCase Test Step to call these common test cases. These "common" test cases can return properties as required.

     

    This structure I am suggesting would look something like:

     

    Project

    |

    |--Test Suite 1

    |  |--Test Case 1

    |  |--Test Case 2

    |

    |--Test Suite 2

    |  |--Test Case 1

    |  |--Test Case 2

    |

    |--Test Suite Common Library

       |--Test Case To Do Set up Things

     

    Where all of the test cases in Test Suite 1 and 2 would call the common library test case "Test Case To Do Set up Things".

     

    Finally I alway disable my "Common Library" test suite so it is never "run" as a stand alone test suite, but you can still quite happily call its test cases.

     

    As a side note your question made me think about the TestCase options? In particular the two options:

     

    • Abort on Error
    • Fail Test Case on Error

    Have you investigated these to see if they help you?.