Forum Discussion

bzh027's avatar
bzh027
New Contributor
8 years ago

How do you organize script units? Do you follow any public standards or best practices?

I recently started working with Testcomplete (specifically the web module) after a long hiatus with even basic scripting, and this is my first foray into the QA space (aka I'm a newb). I've never had to follow any programming standards or worked with a large QA department. I'm looking for suggestions on how to keep script units organized. Here is my plan for now:

 

  • Create stand alone script units with single functions, not tied to QAComplete for things like login, logout, and other components. 
  • Create loop script units for multi browser testing, and data driven loops. 
  • Create 'Test' script units for individual tests based on our QAComplete test plans, that call the functions from the loop scripts and stand alone scripts, passing parameters as necessary. I would link these to the test plans in QAComplete.

 

What strategies or organizational standards do you use? Any suggestions or criticisms of my game plan?

5 Replies

  • How you organize your projects tends to depend more on your needs but a logical structure is always needed and yours seems well considered.

     

    Check out other postings on the same question:

     

    Organization of tests...

    Organizing Test Scripts

     

    I'll add that it can be hard to manage having a lot of script files at one level.  Consider either putting multiple related functions into a script file (like a library), or create some subfolders to help organize.

     

    Try to have a consistent naming convention.  How you name things can be a topic of some religious fervor but pick a style and stick with it.

    • Marsha_R's avatar
      Marsha_R
      Champion Level 3

      Definitely take the time to think about this planning and really have a setup in mind.  It's not impossible to change things later but it can be a pain and if you can come up with something sensible up front, it's worth the time investment now.

    • Colin_McCrae's avatar
      Colin_McCrae
      Community Hero

      joseph_michaud - "Consider either putting multiple related functions into a script file (like a library), or create some subfolders to help organize"

       

      This is pretty much what I do.

       

      The name map tends to cause me more problems than the organisation of script units.