Asset Import Command Line Parameters

Use the STWImport.exe command line utility to import assets from the command line. Import parameters can be specified entirely from a command line, or unless otherwise noted, specified in a configuration file.

The utility is located in \Silk\Silk Test\ng\gui\

Command Line Import Parameters

Syntax Values Required Description
Username (-u) User-defined Yes

The name of the user used to connect. It can only be specified using the command line. Any configuration file specification for this parameter is ignored. When using Windows authentication, omit the user name.

Password (-p) User-defined Yes

The password of the user used to connect. This parameter is required if the password is not Nothing. It can only be specified using the command line. Any configuration file specification for this parameter is ignored. When using Windows authentication, omit the password.

DSN (-d) User-defined Yes

The name of the DSN to use to connect to the database. This parameter is required for any DSN names other than "SilkTest". It can only be specified using the command line. Any configuration file specification for this parameter is ignored.

ImportFile (-if) User-defined

The file name or location of the ZIP file to be imported.

Execute (-ex) Yes | No (see Note below) Yes Commits the import operation. The default value is "No".
Filename (-f) User-defined No
An INI configuration file that stores command line parameters. It can only be specified using the command line.
Note: The INI file parameters override the command line parameters with one exception. The Projects (-prj) and System (-s) parameter values specified in the INI file do not override the same parameters specified on the command line. Instead the values for each are both used.
AllVersions (-av) Yes | No (see Note below) No Imports all versions of the asset(s). The default value is "No".
ReportResult (-rr) User-defined No

Contains the file name and location of the summary report file to be created. The default location is the current directory.

SilentMode (-sm) Yes | No (see Note below) No

Prevents the display of the console output.

Projectmapping (-pm) User-defined No

Specifies the target project to use instead of the original source project from the import file. Multiple mappings can be separated by using the pipe character (|).

Projects (-prj) Asset nodes No Specifies a single project asset or group of project assets for import. All assets in the database will be imported without this parameter. Groups of nodes are separated by the pipe character(|). The format is: {ProjectName}.{AssetType}.{AssetName}.{Ver#}. For example:
 
					 -prj ProjectA.Script.SampleScript.1
Strings separated by the pipe character must be included within double quotes. For example:
-prj "Common | ProjectB.Result"
Note: When specifying the asset type, use the singular form of the asset. For example, use "result" not "results". For asset names comprised of two words (visual test), remove the space (visualtest). There is one exception: test script. Use only the word "script" to specify a test script.
System (-s) Asset nodes No Specifies a single system asset or group of system assets for import. All system assets in the database will be imported without this parameter. Groups of nodes are separated by the pipe character(|). The format is: {SystemName}.{SystemType}.{SystemAssetName}. For example:
-s Options.Record.RecA

Strings separated by the pipe character must be included within double quotes.

ProjectAssetResolve- Conflict (-parc) s | a | p No Specifies the conflict resolution method for project assets that already exist in the database.
  • s stops the import.
  • a adds a version to the asset upon import.
  • p prompts the user to choose an action for each conflicting asset and overrides the SilentMode parameter. p is the default.
SystemAssetResolve- Conflict (-sarc) s | p No Specifies the conflict resolution method for system assets that already exist in the database.
  • s stops the import.
  • p prompts the user to choose an action for each conflicting asset and overrides the SilentMode parameter. 'p' is the default.
Note: To specify the default value of a command line parameter, simply omit the parameter from the command. To specify the non-default value, include only the parameter without its value. For example, to import all versions of an asset, include the AllVersions (-av) parameter without a "Yes" value from your import command. To import only the latest version of an asset, simply omit this parameter to effect the default value of "No".

When specifying parameter values in the import configuration file, the default value is used whenever a parameter or parameter value is omitted. For non-default values, the value must be explicitly stated. For example, to import all versions of an asset, include the AllVersions (-av) parameter together with the value "Yes".

Note: When using Silk Test Workbench 18.5 or later, you cannot import assets that have been exported with a Silk Test Workbench version prior to 18.5. To import such exported assets, use the StwConvertExportedXML program. For additional information, see Importing Assets.

Example

C:/>STWImport.exe -u Admin -p admin -d MyDBName -mt sf -mn "c:\MySTAssetFiles" -prj ProjectA -pm "ProjectA=ProjectB" -rr "c:\STImport.txt" -ex

In the example above, the latest version of ProjectA asset files contained in the MySTAssetFiles directory are imported into ProjectB in the MYDBName database and a file containing a summary report is created.

Example with Configuration File

C:/>STWImport.exe -u Admin -p admin -d MyDBName -f "C:\STimport.ini"

In the example above, only the import parameters that are required to be specified on the command line are included. All other parameters are stored in the configuration file.