Import method
Relevant for: API testing only
Description
Imports the specified Excel data source into your test.
Class
DataSource
Syntax
ExcelFileImportInputArgs <name> = new ExcelFileImportInputArgs(@"<path to data source>", "<data source name in the test>", "header row");
GetDataSource("<data source name>").Import (name);
Note: You must cast the data source in the first line of the syntax in order to use the Import method. If you do not want to cast the data source, use the ImportfromExcelFile method instead.
Parameters
Name | Name assigned to the data source. |
Path to data source | The Windows path to the file for the data source. |
Data source name in the test |
The name the test gives the data source after importing. |
Header row |
A boolean value if the data source has a header row. Possible values are "true" or "false". |
Return Type
An Excel data source added to your test.
Example
ExcelFileImportInputArgs a = new ExcelFileImportInputArgs(@"C:\Users\user\Documents\UFT One\API Test Resources\ConcatenateStrings.xlsx", "Sheet1", true);
GetDataSource("ConcatenateStrings!Sheet1").Import(a);