C Command Line Tools Reference

This appendix lists the parameters for running the OpenScript Command-Line Tools Interface (CTLI). The Command-Line Tools Interface is an umbrella interface for running OpenScript command-line tools. The command-line tools include the OpenScript Command-Line Compiler, the OpenScript Command-Line Asset Updater, and the OpenScript Command-Line Remapper.

To run the Command-Line Tools Interface, type:

[OpenScript Install Dir]/osclti.bat [options]

[options] may consist of options for the OpenScript Command-Line Compiler, the OpenScript Command-Line Asset Updater, OpenScript Command-Line Remapper, or help information.

Prerequisites

The OpenScript Command-Line Tools Interface has the following prerequisites:

  • The OpenScript application must be open on the machine you are using to run the Command-Line Tools Interface.

  • All repositories referenced by scripts being compiled (including function libraries) must be referenced in OpenScript using Manage Repositories on the Tools menu.

C.1 Using the Command-Line Tools Interface

This section describes how to use the command line tools settings.

  • Prints out General help:

    osclti.bat help 
    
  • Runs OpenScript Command-Line Compiler with supplied options. If options are incorrect, it prints the Compiler help and exits:

    osclti.bat compile <options> 
    
  • Prints out OpenScript Command-Line Compiler help:

    osclti.bat compile -help 
    
  • Runs OpenScript Command-Line Asset Updater with supplied options. If options are incorrect, it prints Update Assets help and exits:

    osclti.bat updateAssets <options>
    
  • Prints out OpenScript Command-Line Asset Updater help:

    osclti.bat updateAssets -help
    
  • Runs OpenScript Command-Line Remapper with supplied options. If options are incorrect, it prints Remapper help and exits:

    osclti.bat remap <options>
    
  • Prints out OpenScript Command-Line Remapper help:

    osclti.bat remap -help
    
  • Prints out General help:

    osclti.bat
    
  • Prints out General help:

    osclti.bat <any unknown argument>
    

C.2 Supported Command Line Tools Interface Options

This section lists the command line settings that can be used with the Command-Line Tools Interface.

C.2.1 Command-Line Compiler Options

The following table lists the OpenScript Command-Line Compiler options.

Setting Description
-script [path_to_script_ folder] Specify the path to a single script's folder for single script compilation. One and only one option from -rootFolder or -script options must be specified. Use -rootFolder option for batch build, use -script option for the single script build.

Example usage:

osclti compile -script "C:\OracleATS\OFT\myScript"

-rootFolder [path_to_folder] Specify a folder containing multiple scripts for batch compilation. When -rootFolder is specified, the tool builds all scripts in the subtree of folders underneath it, recursively. One and only one option from -rootFolder or -script options must be specified. Use -rootFolder option for batch build, use -script option for the single script build.

Example usage:

osclti compile -rootFolder "C:\OracleATS\OFT\"

-logFile [path_to_log] Optional. Specify where the compile log output file should go. User must specify a writable location. If -logFile is not specified, then build.log will be created in the user's folder (i.e. C:\Documents and Settings\<username>) or in the OpenScript directory if the user's folder is not writable.

Example usage:

osclti compile -rootFolder "C:\OracleATS\OFT\" -logfile "C:\logs"

-verbose Optional. Specify whether the compiler should use verbose output logging. If -verbose option is specified, then the compiler prints accessed/processed units into the output log file.

Example usage:

osclti compile -rootFolder "C:\OracleATS\OFT\" -logfile "C:\logs" - verbose

-stopBatch Optional. Specify if the batch compiler should stop on any script failure, or continue compiling other scripts even if a failure happens. The default behavior is not to stop the batch compilation on failure.

Example usage:

osclti compile -rootFolder "C:\OracleATS\OFT\" -stopBatch

@optionsFile Optional. Specify a file containing one or more command-line options. Options can be specified on command-line or/and in the options file specified by the @optionsFile option. The options file can specify any option in the same format as they can be specified on the command-line. Additionally, an options file can use a new line as an option delimiter. If the same option is specified on the command-line and in the options file, then the last argument in order of appearance has a precedence.

Example usage:

osclti compile @C:\OracleATS\OFT\options.txt 

C.2.2 Command-Line Asset Updater Options

The following table lists the OpenScript Command-Line Asset Updater options.

Setting Description
-add Specify to add a new asset. One and only one option from -add or -update options must be specified.

Example usage:

osclti updateAssets -add -rootFolder "C:/OracleATS/OFT" -type script -asset alias=globalLib:Repo/GlobalLib;alias=Login:/Repo/Login

-change Specify to change an existing asset. One and only one option from -add or -change options must be specified.

Example usage:

osclti updateAssets -change -rootFolder "C:/OracleATS/OFT" -type databank -asset alias=user:Repo/databanks/ user.csv

-rootFolder [path_to_folder] Specify a folder containing multiple scripts to update. When -rootFolder is specified, the tool builds all scripts in the subtree of folders underneath it, recursively.

Example usage:

osclti updateAssets -change -rootFolder "C:/OracleATS/OFT" -type databank -asset alias=user:Repo/databanks/ user.csv

-type [AssetType] Specify the type of asset being added or updated. AssetType should be one of the following:
  • jar

  • databank

  • objectLib

  • script

The asset updater automatically detects if this asset is a dedicated function library and, if it is, then it makes appropriate changes in scripts to change.

Example usage:

osclti updateAssets -change -rootFolder "C:/OracleATS/OFT" -type databank -asset alias=user:Repo/databanks/ user.csv

-asset [AssetList] Specify the list of one or more asset descriptions to add or change. If changing an asset, then AssetList should contain a single asset description. Separate multiple asset descriptions with a semicolon. For example: assetDisc;assetDisc;... ;assetDisc.

Each asset description should take the form:

alias=chosenAlias:repoName/path to assetFolder relative to Reposiotry/assetFileName

This is the only possible form of specifying assets to add. In this case, each script will be assigned the asset of this type in the specified repository location. Assets will be known to each script by the specified alias. If an asset of the same type with the same alias exists for a script, then the location of the asset will be changed according to command-line arguments.

When changing assets, each script with an asset of the same type with the same alias will change its location according to the command-line arguments.

When changing assets, the asset description can be specified in another form:

oldRepoName/old/path/toAssetFolder/OldAsset FileName=repoName/path to assetFolder relative to Reposiotry/assetFileName

In this case, if any script has an asset in the old location, then without changing the asset alias, the asset location will be changed according to the command-line arguments.

Example usage:

osclti updateAssets -change -rootFolder "C:/OracleATS/OFT" -type databank -asset data1:Default/DataBank/data1.csv

osclti updateAssets -change -rootFolder "C:/OracleATS/OFT" -type databank -asset alias=funclib1:Default/ assetTest/functions/digme/funcLib1

-logFile [path_to_log] Optional. Specify where the compile log output file should go. The logFile should be located in a directory where the user has rights to read, write, change, create and delete this file. If -logFile is not specified, then build.log will be created in the OpenScript directory.

Example usage:

osclti updateAssets -update -rootFolder "C:/OracleATS/OFT" -type databank -asset alias=user:Repo/databanks/ user.csv -logfile "C:\logs"


C.2.3 Command-Line Remapper Options

The remap tool is used for remapping script asset references against regular OpenScript scripts only. The remap tool does not change anything for dedicated function library scripts. Any changes to dedicated function library scripts must be done on an individual basis through the OpenScript UI. Changes to function library scripts should precede changes to regular scripts with the remap tool.

The remap actions as one of: -scriptRelative, -repository or -reponame are mutually exclusive. You can specify only one of them on the command line at a time.

The following table lists the OpenScript Command-Line Remapper options.

Setting Description
-rootFolder [path_to_folder] Specify a folder containing multiple scripts for batch remapping. When -rootFolder is specified, the tool remaps all scripts in the subtree of folders underneath it, recursively.

Example usage:

osclti remap -rootFolder F:/myQA/myFolder/scripts -logFile F:/myQA/myFolder/osclti.log -scriptRelative

-logFile [path_to_log] Optional. Specify where the remapping log output file should go. User must specify a writable location. If -logFile is not specified, then build.log will be created in the user's folder (i.e. C:\Documents and Settings\<username>) or in the OpenScript directory if the user's folder is not writable.

Example usage:

osclti remap -rootFolder F:/myQA/myFolder/scripts -logFile F:/myQA/myFolder/osclti.log -scriptRelative

-scriptRelative Changes all asset references in all scripts under -rootFolder and its subfolders to have script-relative references.

This action does not require any arguments. If the repository for an asset does not exist or a script declaring an asset does not belong to this repository, then any references will not be changed and a warning message will appear.

Example usage:

osclti remap -rootFolder F:/myQA/myFolder/scripts -logFile F:/myQA/myFolder/osclti.log -scriptRelative

This example changes relative-to-Repository asset references to a script-relative references for all scripts under the folder. However, it does not change dedicated function libraries.

-repository repoName=newRepoLoc Changes statically-defined repository mapping for the specified repository to a new location for the current user without starting OpenScript.

The -repository action should be followed by an argument describing the remapping in the form of repositoryName=newRepositoryLocation.

If repositoryName doesn't exist among already defined repositories, then the new repository will be created and mapped to newRepositoryLocation. The remap tool does not check if a repository exists in the old location, but if a repository does not exist in the new location, then the remap tool will not change a repository location, and a warning will be issued.

This action is equivalent to the Edit action of the Repository Manager dialog in OpenScript.

Example usage:

osclti remap -rootFolder F:/myQA/myFolder/scripts -logFile F:/myQA/myFolder/osclti.log -repository \"FusionOats=V:\"

This example changes the mapping of the FusionOATS repository for the current user.

osclti remap -rootFolder F:/myQA/myFolder/scripts -logFile F:/myQA/myFolder/osclti.log -repository \"DynamicRepo=V:\"

This example adds a new repository named DynamicRepo mapped to V: drive for the current user.

-reponame oldRepoName=newRepoName Changes all asset references relative to the named repository in all scripts under -rootFolder and its subfolders to a relative reference to a newly named repository.

The -reponame action should be followed by an argument describing the remapping in the form of oldRepositoryName=newRepositoryName.

The remap tool does not verify the existence of the new and old repositories or the existence of an asset in the old and new repository. It is responsibility of user to have a new repository and assets in the new location, when the script is edited or played back. This action provides the ability to create a repository with scripts dynamically using the new name.

Example usage:

osclti remap -rootFolder F:/myQA/myFolder/scripts -logFile F:/myQA/myFolder/osclti.log -reponame \"FusionOats=ADE\"

This example changes "relative-to-repository FusionOats" asset references to a "relative-to-repository ADE" asset references for all scripts under the specified folder and its subfolders. However, it does not change dedicated function library scripts.

For each changed reference, other parts of the reference, namely, path-relative-to-repository and a file remain intact. Only the repository name changes.