Forum Discussion

Manfred_F's avatar
Manfred_F
Regular Contributor
6 years ago

read number of recent logs keep from script

hi, can I read options.engines.log.number of recent logs keep from a script? i'd like to additionally export .mht log file copies and limit their number..   Regards, Manfred
  • TanyaYatskovska's avatar
    TanyaYatskovska
    6 years ago

    Hi Manfred_F 


    Manfred_F wrote:

    thanks,

    the option seems not to be accessible via script.

    What I tried to is:

    - copy the current log file to .mht, if test is run via TestExecute, and

    - limit the number of .mht log files automatically, as TC limits the number of original logs.

     

    Regards,

    Manfred


     

    If you want to limit the number of MHT files, you can create a script that will do the following:

     

    1) check the number of MHT files in a folder where you store test logs. You can do this via 

    aqFileSystem.GetFolderInfo(<Path>)Files.Count

     

    2) if the number of files is good for you (for example, less than 10), export the test log via

    Log.SaveResultsAs

     

    3) if the number of files isn't good, do some actions with the old MHT files (delete them or move to another folder)

     

    Does this approach work for you?