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
Solved! Go to Solution.
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?
I'm not sure I understand the question. What are you trying to do?
As far as I can tell, that particular option is not accessible via code.
Hi @Manfred_F,
The the Scripting Access to the Test Log Contents article contains a detailed description of how you can work with the log items. Does it help?
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
Hi Manfred,
What I do is a "mobile supress" of some of my files in some folders.
I built a generic method that takes in input :
- a path
- a file extension
- a duration (in days)
I call this method every day in several places
It loops in the folder, and delete every file that matches the extension and that have its last file modification that exceeds the duration that is precised.
you just have to call such function at every time you run your script.
You can get access to the Logs using. Project.Logs.Count with top 1st result will start with 0 & there respective child status Pass and Fail by log.ErrCount for each of them.
Not quite what was being asked... they are looking for the ability to limit the number of exported logs on drive based upon the option being stored for max number of logs?
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?
Thank You all for the info
User | Count |
---|---|
43 | |
23 | |
11 | |
4 | |
3 |
Subject | Author | Latest Post |
---|---|---|