cancel
Showing results for 
Search instead for 
Did you mean: 

Using /exit does not close TestComplete when running from a batch File

SOLVED
Highlighted
Contributor

Using /exit does not close TestComplete when running from a batch File

Hi,

 

I am currently running groups of Tests using a combination of a Jscript file:

 

// RunTestItemGroup.js

var testItemGroup, project;


var objArgs = WScript.Arguments;
var projectSuite = objArgs(0);

for (i = 1; i < objArgs.length; i++)
{
if (objArgs(i).search(/\/testitemgroup:/i) != -1)
{
testItemGroup = objArgs(i).replace(/\/testitemgroup:/i, "");
}
if (objArgs(i).search(/\/p:/i) != -1)
{
project = objArgs(i).replace(/\/p:/i, "");
}

}


var tc = new ActiveXObject("TestComplete.TestCompleteX64Application.12");

var tci = tc.Integration;
tc.Visible = true;
tci.OpenProjectSuite(projectSuite);
ProjectTestItems = tci.TestSuite(project);
tci.RunProjectTestItem(project, testItemGroup);

 

 

and then calling this from a batch file:

 

Wscript.exe "C:\RunGroup.js" "\TestComplete\ProjectSuite\ProjectSuite.pjs" /r /p:TestRun001 /testitemgroup:Other /exit /silentmode
Exit

Does anybody know how to exit TestComplete in this scenario.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Using /exit does not close TestComplete when running from a batch File

Hi,

 

You are manually starting an instance of TestComplete as a COM object in your code. Started TC instance has no clue about parameters that were passed to the script file (RunGroup.js) used to instantiate it thus you must handle this in your code.

https://support.smartbear.com/viewarticle/54655/ illustrates well what you need.

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================

View solution in original post

2 REPLIES 2
Community Hero

Re: Using /exit does not close TestComplete when running from a batch File

Hi,

 

You are manually starting an instance of TestComplete as a COM object in your code. Started TC instance has no clue about parameters that were passed to the script file (RunGroup.js) used to instantiate it thus you must handle this in your code.

https://support.smartbear.com/viewarticle/54655/ illustrates well what you need.

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================

View solution in original post

Contributor

Re: Using /exit does not close TestComplete when running from a batch File

Thank you Alex Smiley Happy

New Here?
Join us and watch the welcome video:
Top Kudoed Authors