Forum Discussion

matthew_morgan's avatar
matthew_morgan
Occasional Contributor
11 years ago

Can Test Complete create new Test Logs programmatically within a single test script?

I am trying to accomplish a requirement for an execution methodology that will have us run a single 'master execution script' (which will take as an input a list of tests that need to be run).  These tests are actually encoded within Excel files.  As such, each Excel File will be its own Test.



Since I won't know ahead of time which tests I want to run during a given test execution, I was hoping I could create a new Test Log (with a test result) within that master execution script...one for each Excel File.  That will allow me to retain the log with the individual test while only running a single script within Test Complete.



Is what I am describing possible? Or will I need to create an offline application that will run a TC script for each Excel file?



I am using jScript in case you have an example of the functionality.

4 Replies

  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor
    You can also use:

    var XLSsheet = "Mysheetname";

    Log.AppendFolder(XLSsheet);

    Log.PopLogFolder();



    This at least makes the single log more legible as you can expand/collapse each log folder.
  • Marsha_R's avatar
    Marsha_R
    Champion Level 3
    We use something like this with our keyword tests when we want to post a separate log.  

    script is called SubmitLog




    Sub ExportResults(LogsName)


    FileName = Project.ConfigPath + "Log\" + LogsName + ".mht"


    Log.SaveResultsAs FileName, 2


    'call Log.SaveResultsAs("C:\\TCResults\\", lsHTML)


    End Sub



    At the end of the keyword test we run it with 



    Run Script Routine   SubmitLog -- ExportResults   LogsName



    where LogsName is the name of the keyword test.



    You should be able to put something similar at the end of each of your tests, or wherever you want a separate log.



     

  • simon_glet's avatar
    simon_glet
    Regular Contributor
    Hi Matt,



    For log splitting we went for the external command solution with a powershell script that you can find here.



    Sincerely
  • matthew_morgan's avatar
    matthew_morgan
    Occasional Contributor
    I did see that and I appreciate your response.  By personal preference I had hoped to keep everything "in the tool"; but if that is the only solution then I guess that's what I'll do.