CopyRemoteLogMode Property

Applies to TestComplete 14.0, last modified on January 23, 2019

Description

The CopyRemoteLogMode property returns a value that specifies whether and when TestComplete copies the results of the task execution to the computer where the master project resides (see the Copy remote log property of the task).

Declaration

TaskObj.CopyRemoteLogMode

Read-Write Property Integer
TaskObj An expression, variable or parameter that specifies a reference to a Task object

Applies To

The property is applied to the following object:

Property Value

An integer value that stands for the assigned mode of copying the remote results. The following values are available:

Value Description
crlAlways TestComplete copies the results to the master computer at the end of each task run.
crlNever The task execution results remain on the remote computer.
crlWhenNotOK TestComplete copies the results to the master computer only if the log of the task execution includes errors and/or warnings.

Example

The following code snippet obtains the task by its name and specifies that TestComplete should copy the task execution's results to the master computer if they include errors. After that, the code runs the specified task.

JavaScript, JScript

function Test()
{

  var Task, TaskName;
  // Specifies the name for the task
  TaskName = "MyTask";
  // Obtains the task by its name
  Task = NetworkSuite.Jobs.ItemByName("MyJob").Tasks.ItemByName(TaskName);

  // Specifies the host on which the task will be run
  Task.Host = NetworkSuite.Hosts.ItemByName("SlaveComputer1");

  // Specifies the path to the project the task will run
  Task.ProjectPath = "D:\\Distributed Testing\\Slave\\SlaveProject.mds";
  // Specifies the test item the task will run
  Task.Test = "Slave_Script\\Script\\Slave\Main";

  // Specifies that TestComplete will always copy task results to the master computer
  Task.CopyRemoteLogMode = crlWhenNotOK;

  // Runs the task
  Task.Run(true);
}

Python

def Test():
  # Specifies the name for the task
  TaskName = "MyTask"
  # Obtains the task by its name
  Task = NetworkSuite.Jobs.ItemByName["MyJob"].Tasks.ItemByName[TaskName]
  # Specifies the host on which the task will be run
  Task.Host = NetworkSuite.Hosts.ItemByName["SlaveComputer1"]
  # Specifies the path to the project the task will run
  Task.ProjectPath = "D:\\Distributed Testing\\Slave\\SlaveProject.mds"
  # Specifies the test item the task will run
  Task.Test = "Slave_Script\\Script\\Slave\\Main"
  # Specifies that TestComplete will always copy task results to the master computer
  Task.CopyRemoteLogMode = crlWhenNotOk
  # Runs the task
  Task.Run(True)

VBScript

Sub Test

  Dim Task, TaskName
  ' Specifies the name for the task
  TaskName = "MyTask"
  ' Obtains the task by its name
  Set Task = NetworkSuite.Jobs.ItemByName("MyJob").Tasks.ItemByName(TaskName)

  ' Specifies the host on which the task will be run
  Set Task.Host = NetworkSuite.Hosts.ItemByName("SlaveComputer1")

  ' Specifies the path to the project the task will run
  Task.ProjectPath = "D:\Distributed Testing\Slave\SlaveProject.mds"
  ' Specifies the test item the task will run
  Task.Test = "Slave_Script\Script\Slave\Main"

  ' Specifies that TestComplete will always copy task results to the master computer
  Task.CopyRemoteLogMode = crlWhenNotOK

  ' Runs the task
  Task.Run(True)
End Sub

DelphiScript

procedure Test();
var Task, TaskName;
begin

  // Specifies the name for the task
  TaskName := 'MyTask';
  // Obtains the task by its name
  Task := NetworkSuite.Jobs.ItemByName['MyJob'].Tasks.ItemByName[TaskName];

  // Specifies the host on which the task will be run
  Task.Host := NetworkSuite.Hosts.ItemByName['SlaveComputer1'];

  // Specifies the path to the project the task will run
  Task.ProjectPath := 'D:\Distributed Testing\Slave\SlaveProject.mds';
  // Specifies the test item the task will run
  Task.Test := 'Slave_Script\Script\Slave\Main';

  // Specifies that TestComplete will always copy task results to the master computer
  Task.CopyRemoteLogMode := crlWhenNotOK;

  // Runs the task
  Task.Run(true);
end;

C++Script, C#Script

function Test()
{

  var Task, TaskName;
  // Specifies the name for the task
  TaskName = "MyTask";
  // Obtains the task by its name
  Task = NetworkSuite["Jobs"]["ItemByName"]("MyJob")["Tasks"]["ItemByName"](TaskName);

  // Specifies the host on which the task will be run
  Task["Host"] = NetworkSuite["Hosts"]["ItemByName"]("SlaveComputer1");

  // Specifies the path to the project the task will run
  Task["ProjectPath"] = "D:\\Distributed Testing\\Slave\\SlaveProject.mds";
  // Specifies the test item the task will run
  Task["Test"] = "Slave_Script\\Script\\Slave\\Main";

  // Specifies that TestComplete will always copy task results to the master computer
  Task["CopyRemoteLogMode"] = crlWhenNotOK;

  // Runs the task
  Task["Run"](true);
}

See Also

Distributed Testing
Run Method
Host Property
ProjectPath Property
ActionAfterRun Property

Highlight search results