Hi Everybody,
I want to share with you the script that executes the group of test items.
For this, you need to do the following:
1. Create the 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\<UserName>\Documents\TestComplete 9 Projects\TestProject1\TestProject1.pjs" project suite in TestComplete 9 and execute the Group1 test items group in the TestProject1 project:
RunTestItemGroup.js "C:\Users\<UserName>\Documents\TestComplete 9 Projects\TestProject1\TestProject1.pjs" /p:TestProject1 /testitemgroup:Group1