Skip to main content

BatchInfo class

Call the Configuration.SetBatch method or Eyes.Batch property with an object of this class to configure the batch for one or more tests.

See How to group tests into batches using the SDK for details and an example.

Using statement

using Applitools;

BatchInfo method

Syntax

BatchInfo batchInfo = new BatchInfo(name, startedAt);

BatchInfo batchInfo = new BatchInfo(name);

BatchInfo batchInfo = new BatchInfo();

Parameters

name

Type: string

The name of the batch. If a null is passed then the name will be taken from the environment variable APPLITOOLS_BATCH_NAME. If the environment variable is not defined then the name of the first test is used as the batch name.

startedAt

Type: DateTimeOffset

The date and time that will be displayed in the Test Manager as the batch start time.

Return value

Type: BatchInfo

Id property

Syntax

string value; // give relevant initial value
batchInfo.Id = value;
value = batchInfo.Id

Type: string

The unique id of the batch. If not passed, or passed as None, and the environment variable APPLITOOLS_BATCH_ID is defined, then the value of the environment variable will be used as the id. If the environment variable is not defined then a unique internal id will be generated and used. Since this value is unique for each test run, if you do not set the id explicitly you can only batch tests that run in the current test run.

Name property

Syntax

string value; // give relevant initial value
batchInfo.Name = value;
value = batchInfo.Name

Type: string

NotifyOnCompletion property

Syntax

bool value; // give relevant initial value
batchInfo.NotifyOnCompletion = value;
value = batchInfo.NotifyOnCompletion

Type: bool

Properties property

Syntax

PropertiesCollection value; // give relevant initial value
batchInfo.Properties = value;
value = batchInfo.Properties

Type: PropertiesCollection

Remarks

  • Call this method after creating the BatchInfo object and before using the Eyes.Batch or Configuration.SetBatch method to associate the batch with the test (before the test is started).
  • Set multiple properties by calling BatchInfo.AddProperty multiple times with the same property name and different values.
  • You should not assign a given value to a property more than once in a given batch run.

Name property

Syntax

//typical code sequence using SequenceName
Batchinfo batchInfo = new BatchInfo('my batch name')
batchInfo.SequenceName = 'My sequence name';
eyes.Batch = batchInfo

Type: string

Remarks

If you do not set this attribute and the environment variable APPLITOOLS_BATCH_SEQUENCE is defined, then the value of the environment variable will be used as the sequence name. If the environment variable is not defined, then the batch will not be associated with any sequence name.

StartedAt property

Syntax

DateTimeOffset value; // give relevant initial value
batchInfo.StartedAt = value;
value = batchInfo.StartedAt

Type: DateTimeOffset

AddProperty method

Syntax

batchInfo.AddProperty(name, value);

Parameters

name

Type: string

The name of the property.

value

Type: string

The value to be associated with this property.

Return value

Type: void

Remarks

  • Call this method after creating the BatchInfo object and before using the Eyes.Batch or Configuration.SetBatch method to associate the batch with the test (before the test is started).
  • Set multiple properties by calling BatchInfo.AddProperty multiple times with the same property name and different values.
  • You should not assign a given value to a property more than once in a given batch run.