Forum Discussion
chicks
13 years agoRegular Contributor
For anyone else who's curious, here's the response I got from the support team.
I haven't experimented with it yet..
=======================================================
Here's a sample solution:
1. Create a RunTestItemGroup.js file with the following contents:
// JScript
var testItemGroup, project;
var projectSuite = objArgs(0);
var objArgs = WScript.Arguments;
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, "");
}
if (objArgs(i).search(/\/project:/i) != -1)
{
project = objArgs(i).replace(/\/project:/i, "");
}
if (objArgs(i).search(/\/project:/i) != -1)
{
project = objArgs(i).replace(/\/project:/i, "");
}
}
var tc = new ActiveXObject("TestComplete.TestCompleteApplication.9");
var tci = tc.Integration;
tc.Visible = true;
tci.OpenProjectSuite(projectSuite);
ProjectTestItems = tci.TestSuite(project); tci.RunProjectTestItem(project, testItemGroup);
2. To open a TestComplete project and run a group of test items, run the RunTestItemGroup.js script with the appropriate command-line arguments, e.g. the following command line will open the "C:\Users\mike\Documents\TestComplete 9 Projects\TestProject81\TestProject81.pjs" project suite in TestComplete 9 and execute the Group1 test items group in the TestProject81 project:
RunTestItemGroup.js "C:\Users\mike\Documents\TestComplete 9 Projects\TestProject81\TestProject81.pjs" /p:TestProject81 /testitemgroup:Group1
BTW, to learn about the logic of the external RunTestItemGroup.js script, please refer to the "Working With TestComplete via COM - Overview" help topic (http://support.smartbear.com/viewarticle/33145/) and those related.
I haven't experimented with it yet..
=======================================================
Here's a sample solution:
1. Create a RunTestItemGroup.js file with the following contents:
// JScript
var testItemGroup, project;
var projectSuite = objArgs(0);
var objArgs = WScript.Arguments;
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, "");
}
if (objArgs(i).search(/\/project:/i) != -1)
{
project = objArgs(i).replace(/\/project:/i, "");
}
if (objArgs(i).search(/\/project:/i) != -1)
{
project = objArgs(i).replace(/\/project:/i, "");
}
}
var tc = new ActiveXObject("TestComplete.TestCompleteApplication.9");
var tci = tc.Integration;
tc.Visible = true;
tci.OpenProjectSuite(projectSuite);
ProjectTestItems = tci.TestSuite(project); tci.RunProjectTestItem(project, testItemGroup);
2. To open a TestComplete project and run a group of test items, run the RunTestItemGroup.js script with the appropriate command-line arguments, e.g. the following command line will open the "C:\Users\mike\Documents\TestComplete 9 Projects\TestProject81\TestProject81.pjs" project suite in TestComplete 9 and execute the Group1 test items group in the TestProject81 project:
RunTestItemGroup.js "C:\Users\mike\Documents\TestComplete 9 Projects\TestProject81\TestProject81.pjs" /p:TestProject81 /testitemgroup:Group1
BTW, to learn about the logic of the external RunTestItemGroup.js script, please refer to the "Working With TestComplete via COM - Overview" help topic (http://support.smartbear.com/viewarticle/33145/) and those related.