SSI
13 years agoOccasional Contributor
Test Execute Export Log
We are running tests with test execute from a vb .net program using the com interface. is there a way to export the log files generated with teh com object?
The method returns the program object only if TestComplete is running script routines. If the script code is not running, the method returns an empty Variant value.
Dim ObjLog As Object = Nothing
Try
Call WriteLog(LogFile, "Running test")
TestCompleteObject.Integration.RunProject(TestProject)
ObjLog = TestCompleteObject.Integration.GetObjectByName("Log")
Catch ex As Exception
TestCompleteObject.Quit()
Call WriteLog(LogFile, "Error: " & ex.Message.ToString)
End Try
' do not move on until test is finished running
Do Until TestCompleteObject.Integration.IsRunning = False
Application.DoEvents()
Loop
Dim LogFileName As String = "C:\ExportLog\Test.mht"
ObjLog.SaveResultsAs(LogFileName, 2) 'lsMHT)
ObjLog = Nothing
Call WriteLog(LogFile, "Finished Running test")
Select Case TestCompleteObject.Integration.GetLastResultDescription.Status
Case TC_LOG_STATUS.lsOk
Passed = True
Case Else
Passed = False
End Select
Call TestCompleteObject.Integration.ExportLastResult("{C32B59B0-6AD4-4921-A545-021C7B76E526}", LogFileName)