Executing Test Group using command prompt
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Executing Test Group using command prompt
Hi folks,
I am facing an issue while executing a Test Group using command prompt.
I have a project which has three Test Groups having sub-folders with TestSteps in it. View image: TestGroups.png
I have to launch TestComplete using command prompt and execute anyone of these Test Groups at a time.
I am using the following two approaches:
1. Using command prompt directly and executing the following command to launch and execute the SECOND Test Group:
"C:\Program Files (x86)\SmartBear\TestComplete 10\Bin\TestComplete.exe" "D:\GitShared\qatestautomation\eWorkspace\IbexAutomation\IBEXGlobal\IBEXGlobal.pjs" /r /project:Portal /testitemgroup:"USPayroll"
This launches TestComplete successfully. However, it executes the first Test Group instead of the mentioned Second Test Group. I have to manually disable the first Test Group in order to launch the second Test Group.
What am I missing here?
2. Using ActiveX to do the same as above:
The second approach is about launching TestComplete using ActiveX and executing the above, using a JS file. However, I am getting an message.
The JS file contents are:
http://support.smartbear.com/viewarticle/54654/
// 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, "");
}
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.10");
var tci = tc.Integration;
tc.Visible = true;
tci.OpenProjectSuite(projectSuite);
ProjectTestItems = tci.TestSuite(project);
tci.RunProjectTestItem(project, testItemGroup);
//End of File
I am using the following command to launch this JS file:
"D:\GitShared\qatestautomation\eWorkspace\IbexAutomation\IBEXGlobal\RunTestItemGroup.js" "D:\GitShared\qatestautomation\eWorkspace\IbexAutomation\IBEXGlobal\IBEXGlobal.pjs" /p:Portal /testitemgroup:"USPayroll"
Executing this is giving me the following error message: View image: Error.png
What is missing here.
Help needed.
Regards,
OS
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adding to it: The JS file gives error message on this line of code:
var tc = new ActiveXObject("TestComplete.TestCompleteApplication.10");
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
> The requested operation requires elevation.
Offhand, I'd say that you need more privileges. Try running as Administrator.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know that I need to run the JS file as Administrator ... How?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also, what is worng with the first approach?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> what is worng with the first approach?
The problem with the first approach is that the /testitemgroup option is not supported by TestComplete command line (http://support.smartbear.com/viewarticle/55587/)
> I know that I need to run the JS file as Administrator ... How?
Either right-click the shortcut for the command prompt and select 'Run as administrator' or use the 'runas' command within command prompt window.
P.S. There is another jscript file that makes it possible to execute specific test item: http://support.smartbear.com/viewarticle/54655/. I did not compare it withthe one referenced by you.
/Alex [Community Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your input Alex.
Here in this article Run the specified group of test items via TestComplete's command line TestComplete mentions of "/testitemgroup"
I have somehow achieved my goal but it's not how I wanted it to work. I have written a routine that call all individual functions in a series so as to make it work like a complete test flow. However, I would still like to execute the Test Item Group as a whole from command line. Still no success.
Regards,
OS
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> Here in this article Run the specified group of test items via TestComplete's command line TestComplete mentions of "/testitemgroup"
The referenced article mentions /testitemgroup as the parameter for the RunTestItemGroup.js (or RunTestItemGroup.vbs) script, but not TestComplete's command line like in your first approach.
The only possible way now to execute test item from the command line is either to use the script referenced by you and me or to create an application that will drive TestComplete using COM.
/Alex [Community Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a bundle Alex. You are always a big help. I wonder why I missed that js parameter thing.
Kind regards,
OS
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To not have the error "The resquested operation requires elevation" in the script when you create ActiveXObject,
In the file C:\Program Files (x86)\SmartBear\TestComplete 12\Bin\TestComplete.exe.manifest, you have to remvove :
- uiAccess="true" ( from : <requestedExecutionLevel level="asInvoker" uiAccess="true"/>)
Source : https://support.smartbear.com/viewarticle/78195/
