Provide for the ability to view logs outside of TC? Our logs are getting too large to keep in the 'Log' directory as part of our regular backup and we don't want to lose the testing history. I would like to move the log folders somewhere else but without a view this is far too tedious.
View Logs Outside of TC
- TanyaYatskovskaSmartBear Alumni (Retired)Status added:New Idea
- william_roeSuper Contributor
Here's what I did (same net affect). Chocolate, wine AND roses should be arriving in a day or two. Have a great weekend and THANKS
function SaveTestResult(){ // Specifies the path to the file that will contain // the test results in the MHT format var currentTime = aqDateTime.Time(); // Return the hours, minutes and seconds parts of the current time value and then post them to the log hours = aqDateTime.GetHours(currentTime); minutes = aqDateTime.GetMinutes(currentTime); seconds = aqDateTime.GetSeconds(currentTime); var f = aqConvert.DateTimeToFormatStr(aqDateTime.Today(), "%Y_%m_%d_") + hours + "_" + minutes + ".mht"; var result = Log.SaveResultsAs("C:\\Users\\svcmrtprdaccpt\\Documents\\TestComplete 10 Projects\\CMWeb Logs\\"+f, lsMHT); }
- Marsha_RModerator
aqConvert.IntToStr(aqDateTime.GetMonth(Now)) + "_" + aqConvert.IntToStr(aqDateTime.GetDay(Now)) + "_" + aqConvert.IntToStr(aqDateTime.GetYear(Now)) + "_" + aqConvert.IntToStr(aqDateTime.GetHours(Now)) + "_" + aqConvert.IntToStr(aqDateTime.GetMinutes(Now)) + "_" + aqConvert.IntToStr(aqDateTime.GetSeconds(Now))
- william_roeSuper Contributor
Absolutely. I'm almost there myself
var f = aqConvert.DateTimeToFormatStr(aqDateTime.Today(), "%y_%m_%d");
william_roe wrote:Provide for the ability to view logs outside of TC? Our logs are getting too large to keep in the 'Log' directory as part of our regular backup and we don't want to lose the testing history. I would like to move the log folders somewhere else but without a view this is far too tedious.
- Marsha_RModerator
Do you have any dark chocolate?
- william_roeSuper Contributor
Do you have any sample code which creates the concatinated file format to match the Test Complete naming convention: 3_15_2015_4_45 PM_04_25.mht?
function SaveLogResults(){ // ... // Specifies the path to the file that will contain // the test results in the MHT format var FileName = "C:\\Users\\svcmrtprdaccpt\\Documents\\TestComplete 10 Projects\\CMWeb Logs\\MyResults.mht"; var result = Log.SaveResultsAs(FileName, lsMHT); }
- Marsha_RModerator
Sure. Happy Friday!
- william_roeSuper Contributor
That is exactly what were looking for. THANK YOU!
william_roe wrote:Provide for the ability to view logs outside of TC? Our logs are getting too large to keep in the 'Log' directory as part of our regular backup and we don't want to lose the testing history. I would like to move the log folders somewhere else but without a view this is far too tedious.
- Marsha_RModerator
You build your own filepath for the exported logs. The examples are for the project path, but it will work for any path as long as each test machine can reach it.
- william_roeSuper Contributor
Moving the logs to another directory so they are not included in the backup. Whether exporting or detaching (remove without deleting) and attaching (existing files) the task can only be done one log at a time. Is there an option to set a log directory not under the project directory?
Related Content
- 8 years ago
- 7 years ago