Forum Discussion

steven_yetter's avatar
steven_yetter
Contributor
3 years ago

"Common" or "Lib" Project

Test Project Library

 

If I have a parameterized test that is used by several other Test Projects in my TestComplete suite, should I put that test with others in its own TestComple Project that doesn't gets run directly along with other similar tests and have a "library" project of common keyword tests?

 

For example, I have test, "Load_spkpro[spkpro_name]" where spkpro_name is the name of an app-specific project. I have test projects Test_IM_spkpro, Test_Q_VLD_spkpro, Test_Z_TT_spkpro, Test_C_SA_spkpro and so on. Each spkpro project in the application has different functionality, different graphs, different tables, different operations, and so really different tests. But before the project is loaded and even when the project is loaded and verified, there are common steps and checkpoints that work for all spkpro project types. Should Load_spkpro be in a separate project with other common tests and treated like a library that doesn't get run directly?

 

What's the approach in TestComplete for having a library of tests that get executed from multiple projects?

 

Let me know if any of the above is not clear and I'll elaborate some more.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    While developing, if you find yourself writing code that does the same thing, then it's ideal to make it as a function and reuse it. Also, don't make the functions complicated, break it down into sections if you can.

     

    If the name of your application that you are testing is called "spkpro", then it's not necessary to name all if your function or projects, appending with "_spkpro".

     

    My Project Suite is called "Asset Liability Suite", within this suite, I have many projects which tests different areas of the tool and are named appropriately (which doesn't include the project suite name). Before each tests are run, I import data into the DB; launch the browser; goto the URL; and login into the application. Tests are executed. Finally, perform a clean-up to get the DB back to it's original state.

    The actions shown in Italics, are functions that are performed all the time before/after tests are executed. These are all stored in a Common project, which can then be used within the project suite.

     

    See https://community.smartbear.com/t5/TestComplete-Questions/Calling-units-from-one-project-to-another-without-Importing-them/m-p/238186

    • steven_yetter's avatar
      steven_yetter
      Contributor

      I saw that article about code from other projects?   What about using keyword tests from other projects?

       

      Project  Test-CSA

           Run IsoSpeak.  (and verify Splash Windows contents for user name etc.)

           Select Admin Mode

           Select Load Project parameter C-SA Path   (and verify Project Summary for C-SA)

           Select Project-Info (and verify experiments for C-SA )

           Select Data Processing (and verify experments data processing status for C-SA)

           Select Export and verify Message box of export type buttons

            Select Score Export (and verify file browser)

            Enter path to export to for C-SA

       

      Project  Test-I-IM

           Run IsoSpeak.  (and verify Splash Windows contents for user name etc.)

           Select Admin Mode

           Select Load Project parameter I-IM Path   (and verify Project Summary for I-IM

           Select Project-Info (and verify experiments for I-IM)

           Select Data Processing (and verify experments data processing status for I-IM)

           Select Export and verify Message box of export type buttons

            Select Score Export (and verify file browser)

            Enter path to export to for I-IM

       

      Select Admin Mode is a step common to both projects.  A test project is for a chip type like C-SA and C- is a chip family.  We have approximately 5 chip families.  There is no way to have Select Admin Mode keyword test in a library project, without converting the keyword test to script?

       

       

           

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    In Keyword testing, I think it's possible to call code, which then calls another keyword test. But I think that may get messy.

     

    "The benefit of keyword tests is that in many cases it is easier and faster to create them than to write the script equivalent. However, the number of actions you can perform in keyword tests by using the operations is limited and sometimes it may be more convenient to run script code to perform tasks"

     

    It might be easier just to copy the keyword test!