Forum Discussion

ajohnson2020's avatar
ajohnson2020
Contributor
13 years ago

Run test item from command line?

Is there a way to invoke a particular Test Item or Group from the command line?  I'm running TestComplete 8.5, and would like to use TestExecute to run individual tests or groups of tests without having to run the entire suite.



Thanks.

Allen

5 Replies


  • Hello Charles,



    We have no time frames for the feature implementation. However, your request has increased the suggestion's rating. Thank you.



    You can enable and run the needed test items or test item groups from an external *.js file via COM. Below are the contents of such a file:





    var tc = new ActiveXObject("TestComplete.TestCompleteApplication.8");

    tc.Visible = true;

    var tci = tc.Integration;

    tci.OpenProjectSuite("C:\\TestComplete 8 Projects\\TestProject1\\TestProject1.pjs");

    ProjectTestItems = tci.TestSuite("TestProject1");

    Group = ProjectTestItems.TestItem(0);

    Group.Enabled = true;

    tci.RunProjectTestItem("TestProject1", Group.Name);

    while(tci.IsRunning())

      WScript.Sleep(100);

    tc.Quit();





    For more information, refer to the "Working With TestComplete via COM - Overview" article and those related.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    You would use the /test command line parameter when executing the test as described in this article.



    http://smartbear.com/support/viewarticle/10998/



    However, note that this does not execute test items as you requested.  What you would do, though, since Test Items are just a graphical reference to Keyword Tests and/or Scripts or other things, you could create a KeywordTest or Script routine that would execute your requested subset.

  • Hi Allen,



    Currently, it's impossible to run test items or groups of test items via the command line. We have a suggestion to make it possible to do that, and your request has increased its rating. Thank you.







  • I was able to achieve this by using testcomplete's integration object . (Integration.RunProjectTestItem) . So what i basically did was installed visual studio , created a console application ,added reference to the testcomplete library to my project and used the available integration objects .



    Used vb code that is given as an example here:

    http://smartbear.com/support/viewarticle/11014/



    Just built the solution into a custom executable file , so now i can trigger project test items using this exe
  • cju's avatar
    cju
    New Contributor
    I have the same need to run a particular group of test cases from command line. I want to divide all the test cases into several groups and run them seperately. When will this feature be supported? At the meantime, any way to work around the limitation?

    Thanks,

    Charles