I have use the below to run specific test groups
and it works.
This is an old article from old SQAForum website.
Software Quality Assurance Forums: Management of tests group runIt does work.
You need to modify below for TC9 use.
JamesK.
==================
Management of tests group run #669502
Hi,
I am using TC-8.2 and TE-8.2. In one project suite, I have many tests.
I used to organize the sequence of them by editing project items.
I made some groups and would like to run exactly group on demand.
For example, on TC all groups are enabled. I need to run second or third group.
start /wait "TestExecute" "C:\Program Files (x86)\Automated QA\TestExecute 8\Bin\TestExecute.exe" "path\ProjectSuite.pjs" /run /project:new projectitem:3_group
3_group is the name of project test item group
It would be nice to get any suggestion, doesn’t matter test complete or test execute.
This parts works fine:
start /wait "TestExecute" "C:\Program Files (x86)\Automated QA\TestExecute 8\Bin\TestExecute.exe" "path\ProjectSuite.pjs" /run /project:new
but every time I need to make changes and save them on TC or to modify manually project.mds file.
I think it should be more attractive way to do this.
Thanks,
Kristina
====
Hi Kristina,
We have a suggestion in our DB to implement the ability to execute test items provided by the
specified group via the command line.
Your post has increased its rating. Thank you.
At the moment, you can accomplish your task in the following way:
1. Create a "launcher.
js" file with the following contents:
Code:
--------------------------------------------------------------------------------
var objArgs = WScript.Arguments;
var app = objArgs(0);
var projectName = objArgs(1);
var itemOrGroup = objArgs(2);
var productsRunning = false;
if(!CheckForInstance("TestComplete.TestCompleteApp lication.8") && !CheckForInstance("TestExecute.TestExecuteApplicat ion.8"))
{
switch (app)
{
case "TC":
var appName = "TestComplete.TestCompleteApplication.8";
if(!CheckForInstance(appName))
{
var comObj = new ActiveXObject("TestComplete.TestCompleteApplicatio n.8");
}
break;
case "TE":
var appName = "TestExecute.TestExecuteApplication.8";
if(!CheckForInstance(appName))
{
var comObj = new ActiveXObject(appName);
}
break;
default:
Stop("Incorrect application. Exiting...");
}
}
else
{
Stop("TC or TE is already running. Exiting...");
}
var iObject = comObj.Integration;
// Specify the path to your project suite; backslashes are doubled
iObject.OpenProjectSuite("path\\ProjectSuite.pjs") ;
iObject.RunProjectTestItem(projectName, itemOrGroup);
while(iObject.IsRunning())
{
WScript.Sleep(100);
}
comObj.Quit();
WScript.Sleep(15000);
function CheckForInstance(ObjectName)
{
try
{
var AppObject = GetObject("", ObjectName);
return true;
}
catch(e)
{
return false;
}
}
function Stop(message)
{
WScript.Echo(message);
WScript.Quit(1);
}
--------------------------------------------------------------------------------
2. Make the command in your batch file look like this:
Code:
--------------------------------------------------------------------------------
start /wait launcher.
js "TC" "new" "3_group"
--------------------------------------------------------------------------------
and execute the batch file.
Note that you can use the following command to run tests using TestExecute:
Code:
--------------------------------------------------------------------------------
start /wait launcher.
js "TE" "new" "3_group"
--------------------------------------------------------------------------------
--------------------
Regards,
Allen - SmartBear Support
===
Hi Allen,
Thank you very much, it really works and helped me so much.