Forum Discussion
Hi,
You can use the below code.
function GeneralEvents_OnStopTest(Sender)
{
try{
aqFileSystem.DeleteFolder(Log.Path, true);
}catch(ex){
Log.Warning("Error in deleting the logs...!" + ex.description);
}
}
However this will leave a <unspecifiec log> entry in the "TestLogs". This is a dangling pointer. This can be removed or this will disppear on closing and reopening the testcomplete.
Hi Ashok
We tried running the script as instructed by you. But we are getting an error message. The log file which has been highlighted in the screenshot attached, does not exist in our server.
Request you to kindly guide us with your valuable inputs.
Kind regards,
Pradeep
- ashokkumareds10 years agoContributor
Hi pradeep,
If you see the delete code aqFileSystem.DeleteFolder(Log.Path, true), it is the path i.e folder itself (\Log\17-07-2015_10_04_09_278) we are deleting with all the subfolders and files. not any specific file.
I can suggest you to debug this variable "Log.Path" and see if the path is really the path mentioned in the error, And also do you have the permissions for deletion from that location.
This is an irrevalent error to the situation, This is coming from different source. Please let me know the outcome. Thanks.