Forum Discussion

glen_lobo's avatar
glen_lobo
New Contributor
10 years ago
Solved

How to Minimizing TestComplete after launching a form using script

To run my tests which have been stored in different mdb's I use a form and select the database path.



But while doing so i have to remember to manually minimize TestComplete or my application which is already running in the background would be never be in focus.



Need to know if there is a way to minimize TestComplete using code?



P.S: Minimize does work when i run the testsuite but then when the form appears it comes right back.
  • Try this before the form is displayed:




    Set oTC = GetObject(, "TestComplete.TestCompleteApplication")


    oTC.Visible = False



    To make it visible again, launch TestComplete again. You'll get an error stating "Cannot launch another instance of this application" and already existing instance of TestComplete will be shown.

4 Replies

  • Try this before the form is displayed:




    Set oTC = GetObject(, "TestComplete.TestCompleteApplication")


    oTC.Visible = False



    To make it visible again, launch TestComplete again. You'll get an error stating "Cannot launch another instance of this application" and already existing instance of TestComplete will be shown.

  • glen_lobo's avatar
    glen_lobo
    New Contributor
    As i mentioned i did that and it works fine until you call for the form.



    The moment the form is displayed Testcomplete is no longer minimized.
  • glen_lobo's avatar
    glen_lobo
    New Contributor
    Using 



    Set oTC = GetObject(, "TestComplete.TestCompleteApplication")

    oTC.Visible = False



    at the start of the code and



    oTC.Visible = True



    at the very end resolved my issue.



    Thanks for the solution.