Forum Discussion

kchoudhury's avatar
kchoudhury
Contributor
13 years ago

COM integration object method to run in silent mode

Hi ,



I have used TestCompletes COM Integration Object and built a custom exe to trigger TestItems from Command line . The problem that i have currently is that i need to make the call IntegrationObject.RunProjectTestItems in silent mode so that it does not prompt for a save dialogue at the end of the test run .



how can i achieve this ?



Will the default exe provided by testcomplete support calling testitems from command line in the near future?


3 Replies

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Kaushik,



    When opened via COM, TestComplete runs in silent mode by default unless you set its Visible property to True.

    You can also force silent mode by assigning the value of 3 to the Manager.RunMode property of TestComplete's COM object.



    As for your question about command line enhancement, we have an existing feature request for it, but I'm afraid there's no timeframe as to if/when this may be implemented. However, I've increased the rating of this feature request in our DB based on your post. In the meantime, you can use the COM approach to run test items silently.
  • Oh cool ill try that thanks ...



    One more thing that i am having a problem with is , we initiate the command line runs from teamcity which is a build management system , the tests get triggered fine and teamcity holds the process until the run is over and exits gracefully when the tests are completed but if i start a test run and i want to stop it from teamcity it doesnt stop which is not the case if i use the default exe provided by testcomplete . If i am using the Testcomplete exe i can start and stop tests directly from teamcity ., so when i do a stop from teamcity the testcomplete/testexecute app process is killed.



    I am not sure how that is handled for a console application , the thing that i think i am missing is i have to add a cancel event handler or something to my customexe , so that it can take cancel requests . If you can help me with this too would be great. I need it to work the same way it works in the default exe provided by testcomplete




  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Kaushik,



    I've never used TeamCity, and I don't know how its stop tests mechanism works. So, I'm afraid, I won't be of much help here. You'll probably get a more useful answer from other TeamCity users like yourself.



    Nevertheless, here're some thoughts. I suspect that when you stop your console app from TeamCity, it only stops the app itself and not other processes that it launched, that's why, TestComplete keeps running.



    It seems possible to programmatically detect when an application is terminated; at least, I've found some examples on the Internet:

    http://stackoverflow.com/questions/474679/capture-console-exit-c-sharp

    http://stackoverflow.com/questions/4186551/ways-to-kill-a-running-program-and-how-to-trap-them

    You can handle this situation in your console app and call the Quit method of TestComplete's COM object to force it to exit.



    Hope this helps!





    p.s. In the future, please post subsequent questions, which are not closely related to the original question, in a new thread. This makes it easier for other users to find answers by browsing and searching the forums. Thanks!