Log.Log.SaveToDisk

Applies to TestComplete 14.61, last modified on April 22, 2021

Description

The SaveToDisk method generates intermediate test results and saves them to the log item collection. You can use this method to obtain the test results at any moment of the test execution. This guarantees that you will not lose the test results. The method is an analog of the Save log every … minutes project property. The difference is that the method lets you save intermediate test results whenever you want, while the project property does this in certain intervals.

Declaration

Log.SaveToDisk()

Result None

Applies To

The method is applied to the following object:

Result Value

None.

Remarks

The test results generated by the SaveToDisk method have the Incomplete status and are marked with a special icon ().

If you call the SaveToDisk method several times in your test, TestComplete will replace the incomplete results each time the method is called. When the test execution is over, the incomplete results are replaced with a generic test log that may have different states — successful, failed and so on.

Example

The following code snippets demonstrate how you can use the SaveToDisk method in your tests. Note that to obtain the results generated by the method, you need to set a breakpoint after you call it. In other words, you need to set a breakpoint on the code line that follows the call of the SaveToDisk method.

JavaScript, JScript

function SavingLogToDisk()
{
  Log.Message("Before saving the log to disk");
  Log.SaveToDisk();
  // Set a breakpoint here
  Log.Message("After saving the log to disk");
}

Python

def SavingLogToDisk():
  Log.Message("Before saving the log to disk")
  Log.SaveToDisk()
  # Set a breakpoint here
  Log.Message("After saving the log to disk")

VBScript

Sub SavingLogToDisk
  Log.Message "Before saving the log to disk"
  Log.SaveToDisk
  ' Set a breakpoint here
  Log.Message "After saving the log to disk"
End Sub

DelphiScript

function SavingLogToDisk();
begin
  Log.Message('Before saving the log to disk');
  Log.SaveToDisk;
  // Set a breakpoint here
  Log.Message('After saving the log to disk');
end;

C++Script, C#Script

function SavingLogToDisk()
{
  Log["Message"]("Before saving the log to disk");
  Log["SaveToDisk"]();
  // Set a breakpoint here
  Log["Message"]("After saving the log to disk");
}

See Also

Test Results
Using Folders
CreateFolder Method
AppendFolder Method
PushLogFolder Method
Error Method
Warning Method
Message Method
Event Method
Picture Method
File Method
Link Method

Highlight search results