GetDataSource method

Relevant for: API testing only

Description

Accesses the specified data source.

Note: This method is typically used when setting a value for a property, parameter, or variable. It is also used in conjunction with other methods which enable you to use the data from the data source, such as GetValue or SetValue.

Back to top

Class

Test Entities

Back to top

Syntax

property value = GetDataSource("<Data source name>").

Back to top

Parameters

Parameter Description
Data source name

The name of the data source, exactly as it appears in the Data pane.

Note: You can right-click the data source in the Data pane and select Copy to ensure that you use the correct name in your code.

Back to top

Return Type

No explicit return object - method only accesses the data source.

Back to top

Example

var DataSourceValue = GetDataSource("WebServiceData!Input").GetValue(0, "CustomerName");
Context.UserLogger.Info(DataSourceValue);

Back to top