slPacker.PackCurrentTest Method

Applies to TestComplete 15.20, last modified on January 19, 2022

Description

The slPacker.PackCurrentTest method compresses the entire set of the current test run's results.

The Script configuration option specifies the archiving configuration that defines which archiving program will be used for compression and how the archiver will do this. Whether the folder tree information will be preserved in the archive depends upon the parameters you set for the archiver via the chosen archiving configuration.

Note that to use the WinZip archiver from TestComplete, the WinZip Command Line Support Add-On plugin should be installed in WinZip. You can download this add-on from http://www.winzip.com/prodpagecl.htm.

Declaration

slPacker.PackCurrentTest(ArchivePath)

ArchivePath [in]    Optional    String    
Result Boolean

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

ArchivePath

The full qualified path to the resulting archive file. If the file extension is omitted, the file will be given the default extension used in archives of the archiving program defined in the archiving configuration that is set by the Script configuration option. If the parameter is omitted, the standard Save As dialog will be called in order to let you enter the name under which you want to save the archive.

Result Value

True if the test results are compressed successfully, False otherwise.

Example

The following example demonstrates how to compress the current test results.

JavaScript, JScript

function PackResults()
{

  var ArchivePath;
  // ...
  // Specifies the path to the resulting archive
  ArchivePath = Project.ConfigPath + "Log\\TestResults";
  // Compresses the current test results
  if (slPacker.PackCurrentTest(ArchivePath))
    Log.Message("The test results have been compressed successfully");

}

Python

def PackResults():

  # ...
  # Specifies the path to the resulting archive
  ArchivePath = Project.ConfigPath + "Log\\TestResults"
  # Compresses the current test results
  if (slPacker.PackCurrentTest(ArchivePath)):
    Log.Message("The test results have been compressed successfully")

VBScript

Sub PackResults

  ' ...
  ' Specifies the path to the resulting archive
  ArchivePath = Project.ConfigPath + "Log\TestResults"
  ' Compresses the current test results
  If slPacker.PackCurrentTest(ArchivePath) Then
    Log.Message("The test results have been compressed successfully")
  End If

End Sub

DelphiScript

procedure PackResults();
var ArchivePath;
begin

  // ...
  // Specifies the path to the resulting archive
  ArchivePath := Project.ConfigPath + 'Log\TestResults';
  // Compresses the current test results
  if slPacker.PackCurrentTest(ArchivePath) then
    Log.Message('The test results have been compressed successfully');

end;

C++Script, C#Script

function PackResults()
{

  var ArchivePath;
  // ...
  // Specifies the path to the resulting archive
  ArchivePath = Project["ConfigPath"] + "Log\\TestResults";
  // Compresses the current test results
  if (slPacker["PackCurrentTest"](ArchivePath))
    Log["Message"]("The test results have been compressed successfully");

}

See Also

slPacker.GetFileListFromFolder
slPacker.Pack
Packer Options Dialog

Highlight search results