Forum Discussion

christianf's avatar
christianf
Occasional Contributor
6 years ago

Running a test from python: how to receive the log file

Hi,

I'm using the following nicked code:

TCApp = win32com.client.Dispatch(r'TestComplete.TestCompleteApplication')
TCApp.Visible = False
TCInt = TCApp.Integration
TCInt.RunProjectTestItem("{}; /r /p:InstallationCS /t:\"Script|Installation_Auto\" /SilentMode /exit'" % ProjectPath)

while TCInt.IsRunning() == True:
          time.sleep(1)

TCApp.Quit()

 

Is there any way to access the log file generated by the RunProjectTestItem call?

6 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    This may be what you are looking for:

    https://support.smartbear.com/testcomplete/docs/general-info/installing/installing-in-silent-mode.html

     

    Verify the silent installation success

    In silent mode, the installation wizard shows no informative, warning or error message. The installation program creates the setup.log file and writes the installation status to that file. You can examine that log file to learn whether TestComplete has been installed successfully.

    The file is located in the folder containing the installation files. Open the file and check the ResultCode value. 0 indicates success, any other values indicate an error. A complete list of error codes is available on this web page:

    helpnet.flexerasoftware.com/installshield19helplib/helplibrary/SetupLog.htm

    • christianf's avatar
      christianf
      Occasional Contributor

      No, that does not address the question at all. I have installed TestExecute and TestComplete already. Now I am trying to run a test item in a test project from a python script and to receive the log file from that run.

      • christianf's avatar
        christianf
        Occasional Contributor

        so I was trying to do something like

        log  = TCInt.RunProjectTestItem("{}; /r /p:InstallationCS /t:\"Script|Installation_Auto\" /SilentMode /exit'" % ProjectPath)

        in order to receive the output, but that doesn´t work out.