guillaume
13 years agoContributor
Calling WaitProcess method from a finalize routine in a ScriptExtension
Hi.
I have a problem with the Finalize routine in a script extension I am trying to create.
The purpose is to close a list of processes at the really end of the execution.
In order to that, the user pushes in a array the process name he wants to close automatically at the end.
Then, when the script extension is unloading from TestExecute environment, the finalize routine does something like that :
function Finalize()
{
try{
for (var i = 0; i < arrProcess.length; i++){
var objProcess = Sys.WaitProcess(arrProcess, 500);
objProcess.Close();
}
}catch(e){
Log.Error(e.message);
}
}
I am facing two different problems there :
I guess that this is not something that should be done, but I am really trying to make this work.
Do you have any idea about how to solve those errors ?
Regards,
Guillaume.
I have a problem with the Finalize routine in a script extension I am trying to create.
The purpose is to close a list of processes at the really end of the execution.
In order to that, the user pushes in a array the process name he wants to close automatically at the end.
Then, when the script extension is unloading from TestExecute environment, the finalize routine does something like that :
function Finalize()
{
try{
for (var i = 0; i < arrProcess.length; i++){
var objProcess = Sys.WaitProcess(arrProcess, 500);
objProcess.Close();
}
}catch(e){
Log.Error(e.message);
}
}
I am facing two different problems there :
- The main one is that the WaitProcess raised an unknown error, without name nor description.
- I am unable to log errors from the exception caught.
I guess that this is not something that should be done, but I am really trying to make this work.
Do you have any idea about how to solve those errors ?
Regards,
Guillaume.