Name Property

Applies to TestComplete 14.10, last modified on June 5, 2019

Description

The Name property returns the unique name of the given job in the network suite's job collection (the Name property of the job). This name can be used to identify the job in this collection via the Jobs.ItemByName property.

Declaration

JobObj.Name

Read-Only Property String
JobObj An expression, variable or parameter that specifies a reference to a Job object

Applies To

The property is applied to the following object:

Property Value

A string that represents the unique name that the given job has in the job collection of the network suite.

Example

The code below obtains a collection of jobs that belong to a network suite and then posts the name of each job to the test log.

JavaScript, JScript

function JobsNamesExample()
{
  // Obtains information about the jobs
  var Jobs = NetworkSuite.Jobs;
  // Obtains the number of the jobs that belong to the network suite
  var Num = Jobs.Count;
  
  // Iterates through the jobs
  for (var i = 0; i < Num; i++)
  {
    // Obtains the current job
    var Job = Jobs.Items(i);
    var Name = Job.Name;
    // Posts the job's name to the test log
    Log.Message(Name);
  }
}

Python

def JobsNamesExample():
  # Obtains information about the jobs
  Jobs = NetworkSuite.Jobs
  # Obtains the number of the jobs that belong to the network suite
  Num = Jobs.Count
  # Iterates through the jobs
  for i in range(0, Num):
    # Obtains the current job
    Job = Jobs.Items[i]
    Name = Job.Name
    # Posts the job's name to the test log
    Log.Message(Name)

VBScript

Sub JobsNamesExample()

  ' Obtains information about the jobs
  Set Jobs = NetworkSuite.Jobs
  ' Obtains the number of the jobs that belong to the network suite
  Num = Jobs.Count
  
  ' Iterates through the jobs
  For i = 0 to (Num - 1)
    ' Obtains the current job
    Set Job = Jobs.Items(i)
    Name = Job.Name
    ' Posts the job's name to the test log
    Log.Message(Name)
  Next
  
End Sub

DelphiScript

function JobsNamesExample;
var Jobs, Num, i, Job, Name;
begin

  // Obtains information about the jobs
  Jobs := NetworkSuite.Jobs;
  // Obtains the number of the jobs that belong to the network suite
  Num := Jobs.Count;
  
  // Iterates through the jobs
  for i := 0 to (Num - 1) do
  begin
    // Obtains the current job
    Job := Jobs.Items[i];
    Name := Job.Name;
    // Posts the job's name to the test log
    Log.Message(Name);
  end;

end;

C++Script, C#Script

function JobsNamesExample()
{
  // Obtains information about the jobs
  var Jobs = NetworkSuite["Jobs"];
  // Obtains the number of the jobs that belong to the network suite
  var Num = Jobs["Count"];
  
  // Iterates through the jobs
  for (var i = 0; i < Num; i++)
  {
    // Obtains the current job
    var Job = Jobs["Items"](i);
    var Name = Job["Name"];
    // Posts the job's name to the test log
    Log["Message"](Name);
  }
}

See Also

Distributed Testing
Index Property (Job Objects)
Jobs Object
ItemByName Property

Highlight search results