Forum Discussion
5 Replies
Sort By
- jkrolczyRegular ContributorI 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 run
It 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. - simon_gletRegular ContributorHi Shrirang,
As the command line works fine, could you post the command line that fails ?
Sincerely - svaze74_1ContributorHi Simon,
Here is the command line that fails.
( "C:\Program Files (x86)\SmartBear\TestExecute 9\Bin\TestExecute.exe" "D:\MaxSql_TestAutomation\TestComplete_ForMaxSqlDesktop\trunk\TC_Automation_Project\TC Automation Project\MaxSql-ARRA-Automation.pjs" /r /p:MaxSql-ARRA-Automation /pi:eFiles /e )
"eFiles" is a folder created on Test Items Editor page of Project Properties page.
Kindly confirm that we can execute tests in folders on test items page. If yes, how to do it.
Thanks,
Shrirang - svaze74_1Contributor
- svaze74_1ContributorThanks for the info. It helped a lot!.
The commandline works fine after making a minor change.
It does not need "/" character before projectitem:name.
This needs to be changed from smartbear site documentation as well !!
Thanks,
Shrirang
Related Content
Recent Discussions
- 3 days agoAndiiiA
- 4 days agomegha_phophalia
Log functions
Solved4 days agoAurore