Forum Discussion

googleid_104927's avatar
googleid_104927
Contributor
10 years ago
Solved

URGENT - IntegrationObject.RunRoutine

I want to run a specific project inside a project suite.

I could have multiple projects inside a project suite.

I have the mds file extension's path with me and I am passing the same to TC integration object.

IntegrationObject.OpenProjectSuite(mdsfile)



IntegrationObject.RunRoutine(mdsfile,"driver", "driver.main") is causing an exception in my application.



Can someone say how to accomplish this ASAP?

Quick response s much appreciated!





  • Hi,

     


    The RunRoutine method obtains the folowing parameters:


    IntegrationObj.RunRoutine(ProjectName, UnitName, RoutineName)


     


    So, to run a script function, you should use something like this (replace the values with yours):


    IntegrationObj.RunRoutine("<ProjectName>", "Unit1", "Main")


     


    If you want to run the entire project, you need to use the RunProject method:


    IntegrationObj.RunProject("<ProjectName>")


     

3 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi,

     


    The RunRoutine method obtains the folowing parameters:


    IntegrationObj.RunRoutine(ProjectName, UnitName, RoutineName)


     


    So, to run a script function, you should use something like this (replace the values with yours):


    IntegrationObj.RunRoutine("<ProjectName>", "Unit1", "Main")


     


    If you want to run the entire project, you need to use the RunProject method:


    IntegrationObj.RunProject("<ProjectName>")


     

  • Hi Tanya,



    Thanks for that... I changed my code accordingly and the exception is gone...



    but , after TC is invoked an alert message says something like "the file driver has been modified outside of testcomplete or in another editor, do you want to load it?"



    How do I go ahead with execution of the test script here?

    And I would want to give "no" as the answer to the alert box...





  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi,

     


    You shouldn't show the TestComplete window when launching tests. Here is the quote from the product documentation:


    When you launch TestComplete via COM, it remains hidden until you assign True to the Visible property of the TestComplete COM object (see above). If TestComplete is hidden and you perform any actions that change the project, you will not see any messages and warnings, which TestComplete shows when it is visible. TestComplete will follow the default processing of these messages and warnings, and it may perform some undesired actions, for instance, it can save changes to the project which you may not want to save. To avoid possible issues, make TestComplete visible.


     


    Refer to the "Working With TestComplete via COM - Overview" article for details.