mjohnsen
13 years agoNew Contributor
Delay TC script until application finishes loading big file
I need my TC script to wait until my application has completed loading a big file (takes > 1hr). Is there an easy, safe way to do this?
I have tried the following combination of code, as none of them fully wait for the application to be responsive:
(The 2 sec delays are there because I have seen MyApp become briefly responsive at times and I want the process to go back to hanging before I start detecting it.)
aqUtils.Delay(2000, "Delays the script execution for 2 secs.");
var p1 = Sys.Process(SystemDefaults.processName);
var dotNetProcess = dotNET.System_Diagnostics.Process.GetProcessById_2(p1.ProcessID);
while(!dotNetProcess.Responding)
{
aqUtils.Delay(10000, "Delays the script execution for 10 secs while waiting for MyApp.");
}
aqUtils.Delay(2000, "Delays the script execution for 2 secs..");
var mainFrame = null;
while (mainFrame === null) {
mainFrame = <MyApp>.WinForms.FindDialog("ClrMainFrame", 2);
}
Help is much appreciated!!:-)
I have tried the following combination of code, as none of them fully wait for the application to be responsive:
(The 2 sec delays are there because I have seen MyApp become briefly responsive at times and I want the process to go back to hanging before I start detecting it.)
aqUtils.Delay(2000, "Delays the script execution for 2 secs.");
var p1 = Sys.Process(SystemDefaults.processName);
var dotNetProcess = dotNET.System_Diagnostics.Process.GetProcessById_2(p1.ProcessID);
while(!dotNetProcess.Responding)
{
aqUtils.Delay(10000, "Delays the script execution for 10 secs while waiting for MyApp.");
}
aqUtils.Delay(2000, "Delays the script execution for 2 secs..");
var mainFrame = null;
while (mainFrame === null) {
mainFrame = <MyApp>.WinForms.FindDialog("ClrMainFrame", 2);
}
Help is much appreciated!!:-)