Forum Discussion

leeasdf9's avatar
leeasdf9
Frequent Contributor
11 years ago

Possible to run an execution list of Testcomplete Project with Test Execute?

Dear Tanya, Dear Support Team,

I just get started with testexecute 9 and would like to run the test complete projects with testexecute on our VMs.

I did read article "Run an individual test item via command line", i think it should be also possible to select and run an execution list from my testcomplete projectsuite via command line or(pls. see sample list below)?

Could you please help me to create a batch file for this task? Thanks for the support.

Br,

Lee



Projectsuite

 testproject1

   keywordtest1

   keywordtest2

   keywordtest3

 testproject2

   keywordtest1

   keywordtest2

   keywordtest3

...

 

  • Hi, another option, which I have just implemented, is to wrap TestExecute as a COM object in a C# Class Library which also contains an XML file reader.


     


    I can feed it an XML file such as the following


     


    <?xml version="1.0" encoding="utf-8"?>


    <tests>


    <test type="ProjectItem">


    <projectName>ProjectB</projectName>


    <projectItemName>ODT</projectItemName>


    </test>


    <test type="Project">


    <projectName>ProjectB</projectName>


    </test>


    <test type="ProjectTestItem">


    <projectName>ProjectA</projectName>


    <projectTestItem>ProjectTestItem3</projectTestItem>


    </test>


    <test type="RoutineEx">


    <projectName>ProjectB</projectName>


    <unitName>Unit2</unitName>


    <routineName>testWithParameter</routineName>


    <parameters signature="source,destination">


    <parameter name="source">thesource</parameter>


    <parameter name="destination">thedestination</parameter>


    </parameters>


    </test>


    <test type="Routine">


    <projectName>ProjectA</projectName>


    <unitName>Unit2</unitName>


    <routineName>testUnit2</routineName>


    </test>


    <test type="Suite">


    <projectName></projectName>


    </test>


    <test type="TestByName">


    <projectName>ProjectB</projectName>


    <testName>KeywordTests|KeywordTestUnit</testName>


    </test>


    </tests>


     


    and the XML file reader reads this file and uses a TestExecute COM object to execute each test based on the attributes and elements of each <test>.


     


    It took me ~1.5 days to write something that works, I just have a few Exception scenarios to code in so your friendly neighbourhood developer should be able to whip something up pretty quick.


     


    For mine, this is a lot nicer and cleaner than working with batch files and the TestExecute command line limitations.


     


    Regards,


    Phil Baird

14 Replies

  • leeasdf9's avatar
    leeasdf9
    Frequent Contributor
    sorry i forget to mention that i also would like to specify the timeout limit for testitems of execution list, can we do that via commandline too?

    Thanks,

    Lee 



    Projectsuite           timeout

    testproject1            

    keywordtest1           5 min.

    keywordtest2           8 min.

    keywordtest3           2 min.

    testproject2

    keywordtest1           30 min.

    keywordtest2           10 min.

    keywordtest3           20 min.

    ...
  • leeasdf9's avatar
    leeasdf9
    Frequent Contributor
    Hi Robert,

    Thanks for your reply, sorry about confusion of "execution list", i mean list of testitems of the project editor, please also see also attached snapshot.

    As you see i have different "execution lists" for different test tasks. i would like to be able to run any of the list with testexecute.

    And for each test there is predefined timeout limit, i created timeout event handler if a testitem runs timeout it should be stopped and go to next testitem.

    Ifi can neither define timeout limit of testitems nor run the list in testexecute, my test performance will suffer from testrun without timeout handler.

    Could you help me to find  a solution? thanks for the support.

    Br,

    Lee

  • leeasdf9's avatar
    leeasdf9
    Frequent Contributor
    Dear Robert Dear Viper,

    Thanks for your help!! I will try the scripts try out. The basic idea was that i did expect that i could run all my testprojects with testexecute just like testcomplete without any additional effort. It seems like testexecute has only very limited feature..

    Br,

    Li
  • leeasdf9's avatar
    leeasdf9
    Frequent Contributor
    Dear Tanya Dear All,

    @Thanks Viper for pointing out my concerns, and the js scripts are very useful for my project.

    Thanks Tanya for your solution, it is the most simple solution to run tests. i did extend the commandos to run serious subprojects in one batch file. It is different way to schedule my tests than TC, but i think i start to work out with TE.

    I thank all of you for your valueable advises, i really appreciate that.

    Br,

    Lee