Skip to content

Commands for Array Creation and Manipulation

There are a great many commands in Worksoft SaaS that are related to arrays (also referred to as 'Data Sets' in Worksoft SaaS).

In Worksoft SaaS, the commands related to arrays can be used to realize the following common requirements of implementing data-driven testing:
  1. Reading a subset of data from a Data File. You may want to read values of specific cell element(s) or all cell values of a single row/column etc and use that data to drive the test
  2. Storing values read from the User Interface in a Loop into an Array (Data Set) so that the Array can be persisted into a Data File at the end of the test
  3. Persisting Data Sets from one test into a Data File and reading the data from that Data File back into a DataSet as part of a subsequent test and using that data to drive the subsequent test. This allows for each of your tests to be small.
The table(s) below lists the commands in the ascending alphabetic order within each category along with a brief description of the purpose behind the command. By clicking on the hyperlinked command name in the table(s) below, you can review more detailed information about a specific command that includes the syntax for you to follow when using the commands. Please note that these commands (constructs) are supported within Worksoft SaaS application (Edit Test Script screen) only and NOT supported in QaSCRIBE test authoring tool.
Command Purpose
ddAddColumn This command can be used to add new column at the last position in the worksheet provided in the 'Target' field
ddAddRows This command can be used to add a specified number of rows to the dataset in memory. Number of Rows to be added to the Dataset can be optionally passed in the 'Value'. The default value is 1.
ddCreateAnalyticsReportFromTestCycleClipboards This command is similar to the ddCreateDataFileFromTestCycleClipboards command which creates consolidated Data File within the TestCycleIdentifier in the form of an excel sheet. The user can access the generated excel sheets in the Analytics Module under Quality branch. This aggregates the data at a Run Definition level and by Data Definition across multiple runs (of the same Run Definition) within the Test Cycle. If you are looking for the report specific to Run Definition and Data Definition, you may need to pass these values in the JSON Object and the report is created accordingly.
ddCreateDataset This command can be used to create a new Dataset in memory with a name as provided in 'Target' with the structure that follows the Data Definition named in 'Value'.Status of the Data Definition can be optionally passed along with the name of the Data Definition. Allowed values for Status are 'W' and 'A'.If not passed, the status of the Data Definition is assumed to be W for WIP.
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.
ddCreateDatasetFromJSONObject
This command is used to create a DataSet from a JSON Object that is given at the target field and the DataSet name is declared in the value field. This DataSet is created using a ddCreateDataSet command which has to be executed before ddCreateDatasetFromJSONObject command anywhere in run time. This DataSet can be persisted by using ddPersistDatasetToDataFile command.
ddCreateDatasetFromXMLDocument
This command is used to create a DataSet from an XML Document that is given at the target field and the DataSet name is declared in the value field. This DataSet is created using a ddCreateDataSet command which has to be executed before ddCreateDatasetFromXMLDocument command anywhere in run time. This DataSet can be persisted by using ddPersistDatasetToDataFile 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.
ddCreateDatasetFromADatafile This command can be used to create a new Dataset in memory from a Data File with Data File name in 'Target' and the Dataset name in 'Value'.Status of the Data File can be optionally passed along with the name of the Data File. Allowed values for Status are 'W' and 'A'.If not passed, the status of the Data File is assumed to be W for WIP.
ddGetCellValueByIndex This command can be used to copy a specific cell's value from one Dataset in memory as specified in the 'Target' field to a Variable in memory that is provided in the 'Value' field. The 'Variable' must exist in the scope of the current Test Run (of a Run Definition or a Scenario Validation).
ddGetCellValueByName This command can be used to copy a specific cell's value from one Dataset in memory as represented by the rowNumber and attribute name from the Datafile from the source Dataset as specified in the 'Target' field to a Variable in memory that is provided in the 'Value' field.The 'Variable' must exist in the scope of the current Test Run (of a Run Definition or a Scenario Validation).
ddGetColumnCount This command can be used to copy a specific column count for Dataset in memory specified in the 'Target' field to a Variable in memory that is provided in the 'Value' field. The 'Variable' must exist in the scope of the current Test Run (of a Run Definition or a Scenario Validation).
ddGetRowCount This command can be used to copy a specific row count for Dataset in memory specified in the 'Target' field to a Variable in memory that is provided in the 'Value' field. The 'Variable' must exist in the scope of the current Test Run (of a Run Definition or a Scenario Validation).
ddGetRowIndexByColumnValue This command is used to get the row index of the cell for a value present in a specific column.
ddGetRowValues This command can be used to copy a specific row from one Dataset in memory as specified in the 'Target' field to a variable in the value field.
ddGetRowValuesByColumnValue This command is used to get the content of the entire row that specific to the column 'value' in the column and store in a data set. To read/retrieve the row values in the dataset, use the ddGetCellValueByName or ddGetCellValueByIndex command for each cell.
ddPersistDatasetToDataFile This command can be used to persist a Dataset in memory into a Data File. If the Data File does NOT currently exist in the scope of the Project, a new Data File will be created in 'Active' status with the name provided. If a Data File exists with the name provided, the entire content of that Data File will be replaced with the data from the Dataset. of the Data File can be optionally passed along with the name of the Data File. Allowed values for are 'W' and 'A'.
ddPersistDatasetToDataFileTemporary This command can be used to temporarily replace the existing data file with the new data dynamically returned from the query/created specifically in the context of the run being executed. The data file will not be persisted to the database and it can be used in dynamic binding within the run that is being executed.

This prevents creating dummy data files, where the data file is persisted only to replace with dynamic binding within that run.
ddPersistDataSetToExcelFile This command is used to persist a Dataset in memory into an Excel file
  • On selecting the 'Override' option, the content gets overridden from the dataset to the excel file
  • On selecting the 'Append' option, the content gets appended to the 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.
  • If the DataSet is created within the test from an JSON file that exists within the “Files” module of your Project using the command ‘ddCreateDataSetFromJsonFile’, then this command will override that original file with the contents of the “DataSet” passed into the “Value” field of this command.

  • If the DataSet was created some other way, meaning not using the command ‘ddCreateDataSetFromJsonFile’, then a new JSON file will be created and persisted into the “Files” module of your project. The keys for the JSON will be the attributes of the data definition mapped to the Dataset and values in the JSON will be the data from the Dataset.
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.
  • 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.

  • If the DataSet was created some other way, meaning not using the command ‘ddCreateDataSetFromXmlFile’, then a new JSON 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.
ddSetCellValueByIndex This command can be used to copy a specific cell's value from a Variable in memory that is provided in the 'Value' field to one Dataset in memory as specified in the 'Target' field. The 'Variable' must exist in the scope of the current Test Run (of a Run Definition or a Scenario Validation).
ddSetCellValueByName This command can be used to copy a specific cell's value from a Variable in memory that is provided in the 'Value' field to one Dataset in memory as represented by the rowNumber and attribute name from the Datafile from the source Dataset as specified in the 'Target' field. The 'Variable' must exist in the scope of the current Test Run (of a Run Definition or a Scenario Validation).
ddSetRowValues This command can be used to copy a specific row from one Dataset in memory as specified in the 'Target' field to another row of a 2nd Dataset in memory that is provided in the 'Value' field.
createAggregationsOnDataset This command allows you to perform aggregations on Datasets and get the results stored into a new target Dataset that is passed into the target field of the instruction.
createAggregationsOnDataFile This command allows you to perform aggregations on Data Files and get the results stored into a new target Dataset that is passed into the target field of the instruction. 

Feedback and Knowledge Base