ddPersistDataSetToXmlFile (Accessing Contents of and Persisting Files within the "Files" module)
Compatible with:
- Purpose
- This command is used to persist a DataSet in the test’s memory either as a new XML file or as an update (override) to an existing XML file into the “Files” module of your project. The name for the XML file has to be provided as part of the “Value” field and the “DataSet” must be provided in the “Target” field of the Test Instruction containing this command.
- 1. If the DataSet is created within the test from an XML file that exists within the “Files” module of your Project using the command ‘ddCreateDataSetFromXmlFile’, then this command will override that original file with the contents of the “DataSet” passed into the “Value” field of this command.
- 2. If the DataSet was created some other way, meaning not using the command ‘ddCreateDataSetFromXmlFile’, then a new XML file will be created and persisted into the “Files” module of your project. The keys for the XML will be the attributes of the data definition mapped to the Dataset and values in the XML will be the data from the Dataset.
- To create a DataSet, Array Creation & Manipulation commands must be used before this command.
- When the DataSet used in the “Value” field of the test instruction containing this command is not created anywhere during the run time before this command gets executed, the test run gets aborted with an error "For one or more Instructions within the Test Script "" that use the "" command, the Dataset name provided in the 'Target' field does NOT exist in the scope of the Test Scenario" message.”
- Syntax
- ddPersistDataSetToXmlFile (dataSetName, XmlFileName)
- Target (mandatory)
- dataSetName
- Value (mandatory)
- XmlFileName
- Return Value
- N/A
- Errors & Exceptions
-
Condition Error/Exception Message When dataset is not defined The dataset passed as input does not exist in the scope of the run.