Forum Discussion

puyopuy's avatar
puyopuy
Contributor
14 years ago

Log Tree question

Hi,



When I add test cases in test items window, every item will list in Log Tree but if I create a main function to call different tests there on only node created in Log Tree all the tests result on the project log.  Is that possible to show a node for every test in main on Log Tree.  The reason we want to use main function instead of adding test items because we got few people working on the same project file, if someone made changes we have merge the mds file which is very difficult to handle it maybe there is workaround but I'm not sure.



Thanks for your help in advance.

Jeff

3 Replies

  • Hi,


    Individual nodes cannot be shown for tests that are called from other tests in the log tree. However, you can append messages posted by each test to an individual folder within the test log, thus forming the needed log structure. For example, you have three functions that are called from the Main function. For each function, you can create a folder in the test log, and TestComplete will add the messages posted by this function to this folder. The following code demonstrates the way you can do this:




    Sub Main()

      Test1

      Test2

      Test3

    End Sub


    Sub Test1()

      Log.AppendFolder("Test1")

      Log.Message "my test 1"

      Log.PopLogFolder

    End Sub


    Sub Test2()

      Log.AppendFolder("Test2")

      Log.Message "my test 2"

      Log.PopLogFolder

    End Sub


    Sub Test3()

      Log.AppendFolder("Test3")

      Log.Message "my test 3"

      Log.PopLogFolder

    End Sub


    The attached image shows the generated log structure.


    For more information on using folders in the test log, please read http://smartbear.com/support/viewarticle/12264/ in the online documentation.


    Also, I recommend that you read the Teamwork online article.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    In the DDT framework that I've constructed, each test creates a folder, each step within the test creates a sub folder, and depending upon the step, different items within the step may create additional folders.  It's, as noted above, just a matter of judiciously placing Log.AppendFolder calls in your code.

  • Thanks Margaret and Robert. This information is very help. I
    really appreciated yours help.