Forum Discussion

peejay1977's avatar
peejay1977
Occasional Contributor
6 years ago

Test case best practises

Hi all,

 

I'm still fairly new to using TestComplete and I have a question. I have searched to find an answer and honestly maybe my Google skills are poor of late but I couldn't find a definitive answer.

 

I have been using our trial of TestComplete while we have been organising purchasing it and I have created multiple sections in a project each to hook into various different systems we use.

 

My question is around writing and executing a test case. I have seen 2 obvious ways of doing this, 1 is from the overall suite level where you can add a step, and then child steps to that etc etc and also to create another script file which has all the test cases inside as functions, each calling other functions step by step.

 

Is there any typical or recommended way or formatting all of the steps of a test case using this software?

 

Thanks

 

 

1 Reply

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    My personal preference corresponds to the first option mentioned by you: when it is possible, I try to organize tests via Test Items and their parent-child hierarchy. ( prashantmohan: there is still a room for improvement of this useful functionality to make it even more handy and useful.)

    Main reasons for this:

    -- With the properly crafted test code, it is possible to manually put the tested application into required state and then start execution of the relevant test item(s) without the necessity to modify source code (comment out functions that must be skipped);

    -- If some test step is implemented as a function with parameters (even with all default ones), it is not possible to start such function from code editor window. But it is possible to create a test item that calls this function and start it from the Test Items window;

    -- It is possible to start execution of some subtree of test items either from the command line or via COM. Again, without the necessity to modify test code sources;

    -- It is possible to have personalized state of Test Items if test project is opened in the Shared Mode (https://support.smartbear.com/testcomplete/docs/working-with/teamwork/sharing-projects.html) (prashantmohan: This functionality seems to be broken in the last versions of TestComplete but I really believe that it will be restored.)