cancel
Showing results for 
Search instead for 
Did you mean: 

Run options in TestExecute

Highlighted
Contributor

Run options in TestExecute

Hello,



I was wondering why there is no way to only run a specific 'Test Item' declared in the project from TestExecute.



Please refer the attached image - I have a project suite with two projects which have two test items each. When I point to the Run menu option, a sub-menu appears where I can select which project to run but there are no sub-menus that show the respective Test Items.



Currenttly, I have to edit the project item in TestComplete on the development machine (by unchecking the remaining Test Items) and then copy over the updated file to the test machine. Or sometimes I create a batch file with the commad to run only the test item I am interested in. This is a little inconvenient.



It would be nice if someone could suggest any other possible easier way or it would be great to see that feature in the next version of TestExecute.



- GJ
7 REPLIES 7
Highlighted

RE: Run options in TestExecute


Hello GJ,



You can run a specific test item via COM. Here is a sample Windows Script Host script file that opens a specific project in TestExecute and runs a test item in it. Save the below code to a js file and run the file by double-clicking it in Windows Explorer:





var projectSuite = "c:\\ProjectSuite\\ProjectSuite.pjs";

var project = "Project";

var testItem = "ProjectTestItem";





try {

  var te = GetObject("", "TestExecute.TestExecuteApplication");

}

catch(e) {

  te = new ActiveXObject("TestExecute.TestExecuteApplication");

}





openProjectSuite(projectSuite);

runTestItem(project, testItem);

te.Quit();





function openProjectSuite(projectSuitePath)

{

  var integration = te.Integration;

  if (projectSuitePath != integration.ProjectSuiteFileName) {

    integration.CloseProjectSuite();

    integration.OpenProjectSuite(projectSuitePath);

  } 

}





function runTestItem(projectName, testItemName)

{

  var integration = te.Integration;

  integration.RunProjectTestItem(projectName, testItemName);

  while (integration.IsRunning())

    WScript.sleep(100);

}





Also, we have a suggestion in our database to make it possible to run individual test items via the command line, and your request has increased its rating. Thank you.







--
Dmitry Nikolaev

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Contributor

RE: Run options in TestExecute

Hi David,



This is certainly a very creative way to run individual test items! I'll use it - Thanks.



BTW - I am a little confused by the 'we have a suggestion in our database to make it possible to run individual test items via the command line' statement.



Did you mean the 'Run' menu option? It is documented that individual test items can be run via command line.



- GJ
Highlighted

RE: Run options in TestExecute


Hello GJ,



There is no way to run individual test items via the command line: there is a misprint in the TestExecute Command Line help topic, the correct text is (/project:project_name /test:test_name). So, you can run tests, not test items. We will correct the information.







--
Dmitry Nikolaev

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Contributor

RE: Run options in TestExecute

Thanks for the confirmation David.



It would be nice to see the option to run individual test items both through command line as well the the 'Run' option in the right-click context menu.



Hoping to see a new minor release with these functionalities available soon.



- GJ
Highlighted

RE: Run options in TestExecute


Hello GJ,



Running individual test items via the Run submenu will be impossible: as it is said in the Before Running Test Projects In TestExecute section of the Overview help topic, projects and project suites need to be prepared in TestComplete as TestExecute is just a player and does not allow to work with the internal structure of a project.







--
Dmitry Nikolaev

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Not applicable

RE: Run options in TestExecute

Hi,



I was wondering if this has been fixed in the documentation?  The article here has a "/project: project_name /projectitem: item_name" line that may imply that a project can be followed by a test item on the TestExecute command line.
Highlighted
Community Manager

RE: Run options in TestExecute


Hello Jeremy,


 


The documentation was fixed. Project items are not the same as test items.


 

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Changing options from outside of TestComplete

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!
Top Kudoed Authors