Forum Discussion

sether's avatar
sether
New Contributor
15 years ago

Separating Test Log for multiple test items

I have a need to be able to automatically export a separate log for each test item selected in the Test Suite during a run. Is there a method for doing this?
  • Hi Seth,


    Currently, TestComplete does not have a functionality to export results of an individual test item. We have a corresponding suggestion in our database, and your request has increased its rating. In the meantime, you can use the Log.SaveResultsAs method to save the entire test log. Please read the "Log.SaveResultsAs" article for more information.

  • Hi 

         If testitem ran successful means log result  can export to specfied location.  but in case any intrupts happens means how to export those error results. I tried to do create some event handlers GendralEvent_OnStopTest in this I call export testlogresult function. Is it corret or not? 
  • Hi Dhanapal,


    According to the OnStopTest Event help topic, the OnStopTest event occurs when TestComplete is stopping a test. In the topic, you can find the list of actions and behavior due to which TestComplete stops running a test. So, you can use this event handler to export the test results in it.
     

  • Hi,


    I am trying to get the below Information once the Test Suite Execution is completed.Is their any built in function available? I am exporting test log against each test case.  one unit may contain 3 test case.  such a way i scripted to export the test log in HTML format.  Test Log result folder consist of test.xml and root.xml  thru this i can get status of the test log result and test script name after XML parsing but I couldn't get error, pass and warning counts. How do i get those informations?



    function AppExportResultsHTML(scriptName)

    {    

      var FileName;

      var FilePath;

      var CompleteFileName;

      FileName = scriptName + Utilities.FormatDateTime("mm_dd_yyyy_hh_mm_ss_zz_z_", Utilities.Now());

      FilePath = "C:\\TestResults\\";

      CompleteFileName = FilePath + FileName ;

                      if (!(Log["SaveResultsAs"](CompleteFileName, 1)))

                        {       

                          Log["Message"]("CompleteFileName: " + CompleteFileName);

                          Log["Error"]("Could not generate unique log file.");    

                        }




    }




    Test logs are getting displayed in accumalated fasion.


     
































    Unit-name



    Testcase-Name



    no.of.steps



    no.of.steps in Test-Log Results



    Driver Script



    login



    3



    3



     



    Transaction



    5



    3+5



     



    log-off



    7



    3+5+7




        Once test logs are exported as HTML under Test result -> Testcase-Name+TimeStamp folder which contains  Testlog.xml (having step wise execution information) and root.xml (having unit name and status of test log).


     

    Obstacle


     

    1.     Accumalated  test log results.


    2.     Lack of test summary information.