Forum Discussion

ArmandsBruns's avatar
ArmandsBruns
Frequent Contributor
12 years ago

Log.SaveResultsAs ".mht"

Hi,



Maybe someone can help me.



I am using the following procedure:

everything works very good.

Only I wish to file size for each test case will be

Is it possible that the file size of each test case has its own size, not every time increase.

-----------------------------------------------------------




Sub Export_TestComplete_Log_Files(TestCase)


  


  Dim FileName, TC


  


  sPath = Project.Variables.TestCompleteLogFiles 


  Call aqFileSystem.CreateFolder(sPath)                    


  Log.Message ""+sPath+""


  TC = TestCase & "_Test_Case   


  Time_now=Utilities.Now


  Date=Utilities.FormatDateTime("yyyy.mm.dd", Time_now)


  Time=Utilities.FormatDateTime("hh.nn.ss", Time_now)


  FileName=""+Project.Variables.TestCompleteLogFiles+""+TC+"_"+Project.variables.version+"_"+VarToStr(Date)+"_"+VarToStr(Time)+".mht" 


  Log.Message ""+FileName+""


  Log.SaveResultsAs FileName, 2


  


End Sub

-----------------------------------------------------------



Best regards

Armands

  • I believe this means that TestComplete will export the log per the items as defined on the Test Items tab of the current Project.

  • I believe this means that TestComplete will export the log per the items as defined on the Test Items tab of the current Project.

  • karkadil's avatar
    karkadil
    Valued Contributor
    The size of the MTH file (as well as the log itself) depends on the number of messages, screenshots, etc. posted there.



    If you constantly add new tests to your test suite, the size of the MHT file will increase.
  • ArmandsBruns's avatar
    ArmandsBruns
    Frequent Contributor
    Hi Gena,



    Thanks for your support.



    What is a possible solution if I want  to create separate log file for each test case.



    regards

    Armands
  • ArmandsBruns's avatar
    ArmandsBruns
    Frequent Contributor
    Thanks Gena,



    So, I tried the following and I got the same result (every time increase the log file)



    Log.SaveResultsAs FileName, 2, True, 2



    LogScope:



























    Constant

    Value

    Description

    lesFull

    0 (default)

    Export full test log.

    lesCurrentProject

    1

    Export the test log of the currently executed project.

    lesCurrentTestItem

    2

    Export the test log of the currently executed test item.



    What it exactly does it mean - "lesCurrentTestItem" (is it meant as a unit script or something else