Kateryna
13 years agoContributor
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:
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?
- Hi Kateryna,
Do you mean that you want to stop the test as when clicking the Stop button in the TestComplete IDE? This isn't possible using command-line automation - you need to run TestComplete via COM or use the Connected Application technique instead. Please see examples in the Working With TestComplete via COM - Overview article.
When using COM automation, you can stop tests using the IntegrationObj.Stop method, in Connected Applications - using Connect.StopTest.