Commands for Accessing Contents of and Persisting Files within the "Files" module
In Worksoft SaaS, the commands can be used to realize the following common use cases from within automated tests:
- Reading contents of TXT, JSON, XML and Microsoft Excel files that exist within the "Files" module of your project.
- Storing (persisting) DataSets in memory as new or updates to existing XML, Json or Microsoft Excel files into/within the "Files" module of your project
Command | Purpose |
---|---|
ddCreateDataSetFromExcelFile | This command is used to create a new dataset in memory with a name specified in the 'Value' field |
ddCreateDataSetFromJsonFile |
This command is used to create a DataSet from an Json File that is present within the "Files" module in the project. The command takes as input two parameters (a) In the "Target" field, the "Json Filename" and (b) In the "Value" field a DataSet name. This dataset must have been created using the "ddCreateDataSet" command within a test instruction that is executed within the same test but prior to (ahead of) the test instruction which contains the “ddCreateDataSetFromJsonFile" command. |
ddCreateDatasetFromXmlFile |
This command is used to create a DataSet from an Xml File that is present within the "Files" module in the project. The command takes as input two parameters (a) In the "Target" field, the "Xml Filename" and (b) In the "Value" field a DataSet name. This dataset must have been created using the "ddCreateDataSet" command within a test instruction that is executed within the same test but prior to (ahead of) the test instruction which contains the this command. |
ddPersistDataSetToExcelFile | This command is used to persist a Dataset in memory into an Excel file
|
ddPersistDataSetToJsonFile | This command is used to persist a DataSet in the test’s memory either as a new JSON file or as an update (override) to an existing JSON file into the “Files” module of your project. The name for the JSON 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.
|
ddPersistDataSetToXmlFile | 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.
|
storeContentFromFile | This command is used to "store" the contents of a "file" of txt, json and xml file formats present within the "Files" module in the project. The command takes as input two parameters (a) In the "Target" field, the "Filename" and (b) In the "Value" field a Variable name into which the file contents will be stored into. . |