Forum Discussion

Andrew_89's avatar
Andrew_89
Occasional Contributor
8 years ago

Add Item to Log at same level as Test Item

I have a test item which calls a scripted function.

The function iterates through a list and calls multiple tests based on the content of the list.

 

For each iteration of the script, I currently get one entry in the Test Log. 

Is it possible to shift the logs up a level in the logging hierarchy and have one entry in the Log Items for each iteration.

 

What I really need is to be able to dynamically build and execute test items via scripting, but this doesn't seem to be possible, so I am looking for an alternative way to get the logs in the format I need.

 

The logs need to be in this particular format as they are exported and parsed by an external reporting system. The parser only looks at the test item level of the logs.

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Unfortunately, there is no way to do either of what you are wanting to do in TestComplete right now.  You can't elevate logs to the Test Item level and you can't dynamically add TestItems (on that latter, think of the "TestItem" as part of the "compiled" code of your test project... when you run the project, you compile the code... and you can't change code after it has been compiled in the packaged executable).

     

    You may need to alter your log parser.... but you can help yourself a bit with it... Look up Log.AppendFolder and Log.PopFolder.  This will add "levels" to your log that you can tell your parser to look at instead of the top level.  See if that works for you.