Ask a Question

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

christianf
Occasional Contributor

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 6
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.ht...

 

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
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
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.

Well, since I don't know what your code does, I was going by this to figure out what you're doing

Script|Installation_Auto\" /SilentMode /exit'

 

Now that you've asked the real question, I can answer that.  You can put test logs anywhere you want for easy access:

https://support.smartbear.com/testexecute/docs/logs/choose-storage-location.html

 

tristaanogre
Esteemed Contributor


@Marsha_R wrote:

Well, since I don't know what your code does, I was going by this to figure out what you're doing

Script|Installation_Auto\" /SilentMode /exit'

 

Now that you've asked the real question, I can answer that.  You can put test logs anywhere you want for easy access:

https://support.smartbear.com/testexecute/docs/logs/choose-storage-location.html

 


To add to @Marsha_R 's response, the log file is written out in the Log subfolder of the project for which you are executing the tests.  So, whever that is, that's where the log file lives.  What you MIGHT want to do, if you want specific control over that location during a test execution, especially since you are doing an integration of TC into some other application, is to include the commandlines for exporting the log to a file.  There are several formats available, just choose what works best for you.

Refreence the "ExportLog" commandline switch at

https://support.smartbear.com/testcomplete/docs/working-with/automating/command-line-and-exit-codes/...


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
TanyaYatskovska
SmartBear Alumni (Retired)

Hi @christianf,

 

Have you found a way to implement your task? Do you mind sharing it with us?

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



cancel
Showing results for 
Search instead for 
Did you mean: