difference between Process.WaitForInputIdle and App.Sleep
Posted: Wed Apr 15, 2009 12:08 pm
Hi All,
I am testing Visual Studio Addin, so my test open visual studio process and do some tests now problem is at the time of closing its take too much time
so, i have to wait till the process is properly exist
Added code like
==============================================
if (vsProcess.HasExited) return;
Application.Sleep(1000);
vsProcess.WaitForInputIdle(waitTimeMaxMsecsShutdown);
vsProcess.CloseMainWindow();
vsProcess.WaitForExit(waitTimeMaxMsecsShutdown);
Application.Sleep(2000);
int count = 0;
while (!vsProcess.HasExited && count < 5 )
{
this.SaveSolution();
Application.Sleep(200);
}
if (!vsProcess.HasExited)
{
vsProcess.Kill();
throw new Exception("Can not close Visual Studio -> Killed it");
}
==============================================
is it optimize way to check process exit or else kill it after few time.
Any good solution from Ranorex.
samething for opening visual studio as it take too much time so cant predict how much handle it.
Thanks and Regards,
Nitin
I am testing Visual Studio Addin, so my test open visual studio process and do some tests now problem is at the time of closing its take too much time
so, i have to wait till the process is properly exist
Added code like
==============================================
if (vsProcess.HasExited) return;
Application.Sleep(1000);
vsProcess.WaitForInputIdle(waitTimeMaxMsecsShutdown);
vsProcess.CloseMainWindow();
vsProcess.WaitForExit(waitTimeMaxMsecsShutdown);
Application.Sleep(2000);
int count = 0;
while (!vsProcess.HasExited && count < 5 )
{
this.SaveSolution();
Application.Sleep(200);
}
if (!vsProcess.HasExited)
{
vsProcess.Kill();
throw new Exception("Can not close Visual Studio -> Killed it");
}
==============================================
is it optimize way to check process exit or else kill it after few time.
Any good solution from Ranorex.
samething for opening visual studio as it take too much time so cant predict how much handle it.
Thanks and Regards,
Nitin