SaveDumpToLog Method

Applies to TestComplete 15.70, last modified on December 17, 2024

Description

Creates a process dump (a .dmp file) in the project’s Log folder and adds the link to the dump file to the test log.

This methods creates dumps in the minidump format. The dump includes the following information:

  • stack traces for all threads existing in the process,

  • recently unloaded modules,

  • data referenced by locals or other stack memory.

  • (optional) the entire memory of the process.

Declaration

ProgObj.SaveDumpToLog(FullMemory)

ProgObj An expression, variable or parameter that specifies a reference to one of the objects listed in the Applies To section
FullMemory [in]    Optional    Boolean Default value: False   
Result None

Applies To

Parameters

The method has the following parameter:

FullMemory

Specifies whether to include the entire memory of the process in the dump.

Result Value

None.

Example

The following script closes an application and waits for it to close for 1 minute. If the application does not close, the script calls the SaveDumpToLog method to create a dump and to add it to the test log.

JavaScript, JScript

function Test()
{
  var p = Sys.Process("MyApp");

  // Do something
  // ...

  p.Close();
  if (p.Exists)
  {
    Log.Error("Application hung on close.");
    p.SaveDumpToLog();
    p.Terminate();
  }
}

Python

def Test():
  p = Sys.Process("MyApp");

  # Do something
  # ...

  p.Close()
  if p.Exists:
    Log.Error("Application hung on close.")
    p.SaveDumpToLog()
    p.Terminate()

VBScript

Sub Test
  Dim p
  Set p = Sys.Process("MyApp")

  ' Do something
  ' ...

  Call p.Close()
  If p.Exists Then
    Call Log.Error("Application hung on close.")
    p.SaveDumpToLog
    p.Terminate
  End If
End Sub

DelphiScript

procedure Test;
var p;
begin
  p := Sys.Process('MyApp');

  // Do something
  // ...

  p.Close();
  if p.Exists then
  begin
    Log.Error('Application hung on close.');
    p.SaveDumpToLog;
    p.Terminate;
  end;
end;

C++Script, C#Script

function Test()
{
  var p = Sys["Process"]("MyApp");

  // Do something
  // ...

  p["Close"]();
  if (p["Exists"])
  {
    Log["Error"]("Application hung on close.");
    p["SaveDumpToLog"]();
    p["Terminate"]();
  }
}

See Also

Creating Process Dumps During a Test Run
SaveDumpToFile Method

Highlight search results