Forum Discussion

Kateryna's avatar
Kateryna
Contributor
13 years ago
Solved

Stop TestComplete Suite execution using C# code

Hello,



How can I stop TestComplete Suite execution using C# code? This is how my code looks like:

object



 



 



TestCompleteObject = null;



System.Diagnostics.



 



Process rfp = new System.Diagnostics.Process();




string args = @"C:\AutomatedTests\Test\3.2SR1\SystemSetup\SystemSetup.pjs -r -e -SilentMode";




string SystemSetup = @"C:\Program Files (x86)\Automated QA\TestComplete 8\Bin\TestComplete.exe";


string TCProgID = "TestComplete.TestCompleteApplication.8";



rfp = Process.Start(SystemSetup, args);

rfp.WaitForExit(1000 * 60 * 60 * 3);



if (rfp.HasExited == false)



{ rfp.Kill();}



But if I Kill the process project suite log won't be saved. How can I stop execution and close Test Complete instead of killing the process?