Forum Discussion

anandkumar's avatar
anandkumar
Contributor
12 years ago

how to avoid 'save project popup' upon closing the project after run

Hi



i run scripts through automator. few scripts upon closing after run throws a popup asking 'do u want to save the project'.

also its a saved script which is opened, ran and no changes made to project while running, still then it gives that popup.



how to avoid such popup. bcz its an automated process and such popup will affect rest of the script execution.

need some method to handle from test complete perspective.



thanks in advance

10 Replies

  • Hi Stuart,



    Thanks for ur reply. i run the project through python automator not through command line. as of now i need a solution to handle that popup while closing the project. bcz without closing it none of other projects getting executed.
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Anand,



    To avoid confirmation messages when running TestComplete via COM, you can assign the value of 3 to the Manager.RunMode property of TestComplete's COM object.
  • Hi Helen,

    thanks for ur reply. as of now i'm running the TC scripts through python it would be fine if i get a solution for this way.

    let me checkout COM method as well.
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Anand,



    I might have misunderstood your situation. Could you please clarify how exactly you launch TestComplete using Python (for example, post your Python script here)?
  • Hi

    here is the code for python



    TCApp = win32com.client.Dispatch(r'TestComplete.TestCompleteApplication')

    TCInt = TCApp.Integration

    TCInt.RunProjectTestItem("c:\test.pjs;proj;testItem")

    while TCInt.IsRunning() == True:  

        time.sleep(1)

     TCApp.Quit()



    after running, when the quit operation is performed the popup comes
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Anand,



    Your code actually uses the TestComplete COM object - TestComplete.TestCompleteApplication. So, as I wrote before, you need to set the TCApp.Manager.RunMode property to 3 to activate the silent mode.
  • Hi Helen



    fantastic.



    it worked very well. i also found one more method

    TCApp.Visible = False

    this also works instead of silent mode.



    so happy, thank u very much. :)


  • Hi Helen,



    one more thing similiarly,



    1)while opening the script for the first time from a shared drive one popup comes like 'this is from a shared drive do u want to open'

    2) also if there is some prob in script log then also one popup comes while opening the script



    both the above problems are not solved by the silent mode. it only suppress the popup during closing of script. so how can this be handled. so from beginning of the script opening till TC is closed i dont want any popups related to TC.



    thanks in advance.