TC-Shell commands

Standard commands

TC-Shell – Default Commands

help or ?

Provides the list of possible commands

exit

Closes the current TC-Shell session. This is only relevant for the interactive mode. If there are unsaved modifications, the user will be asked whether they should be saved or discarded.

save

Saves all previously conducted modifications.

saveAndUnloadAll

Saves all modifications that were made up to this time and releases used memory.

adminModusOn

Enables the administrator mode

adminModusOff

Disables the administrator mode

print

Provides all known information on the current object (attributes and all objects in direct relation)

set

set <attributeName> = <Value>

In the current object it sets the attribute with the specified value, as far as the attribute can be modified (i.e. if it is not a readonly attribute and is allowed to be modified).

The symbol = as symbol of assignment is optional.

get

<attributeName>

Returns the attribute value of the active object

getAllOptions

Displays all current values of all within the TC-Shell settable options (see chapter "Starting TC-Shell").

getBranches

Prints all branches that are available within the common repository.

getOption

<optionName> Displays a value of a given option

setOption

<optionName> ["="] <optionValue>

Sets a given option to the stated value. This change applies only to the current session.

The symbol = as symbol of assignment is optional.

saveOptions

Saves all option values for use beyond the current session

setproperty

SetProperty <PropertyName> ["="] <Value>

Creates an individual customized property for the current object. If a property of the same name exists already, only the value is transferred.

The symbol = as symbol of assignment is optional.

settcparam

settcparam <Name of test configuration param> = <Value>

Creates a test configuration param for the current object with the specified value.

The symbol = as symbol of assignment is optional.

compactworkspace

Deallocates unused storage in the local repository of a workspace and thus improves the performance. Considerable improvement in the performance can only be seen with extensive database files in a workspace.

createdbbackup

createdbbackup <backup directory>

Creates a backup of the repository in the defined directory.

In script mode, add yes or no after <backup directory> depending on whether you want to include versioning history in the backup.

In interactive mode, decide whether to include versioning history in the backup in the subsequent dialog.

Modify commands

The values of all object properties can be modified in the TC-Shell via modify commands (which are available in the context menu of Tosca Commander™). It is also possible to use regular expressions (UseRegularExpression).

Modify Name

Description

Modify object name

Example

[23]='Modify Name'

[24]='Modify Description'

[25]='Modify SynchronizationPolicy'

[26]='Export Subset'

Select Task to execute by number # [1-26,0=none] or by name > 23

Use Regular Expression (yes/no) > n

Replace with: > <new name>

TCFolder:test > <new name>

Modify Description

Description

Modify description of objects

Example

Use Regular Expression (yes/no)> y

Search for:> <name>

Replace with:> <new name>

Current object

In the TC-Shell there is always a current object. If either a workspace is opened or if an object is deleted, the project object will automatically be the current object.

The following commands are available in order to jump to other objects:

TC-Shell commands for navigating between objects

'JumpToProject'

The project object becomes the new current object.

'JumpToNode <NodePath>’

All objects have a NodePath, which contains the name including the hierarchical positions (can be seen in the Properties view in Tosca Commander™). If this command is specified along with the NodePath, the system jumps to a specific object.

Example:

> JumpToNode "/TestCaseFolder/SampleTestCases/
Automated TestCases"

This selects a folder and converts it into the next current object.

'JumpTo<uniqueQueryString>'

<uniqueQueryString> is an arbitrary TQL query string which returns exactly one object.

To search a TestCase of a specific name, starting from the project:

"=>Items:TestCase[Name==\"TC1\"]"

or to switch from a TestStepValue to the parent TestStep:

"->Test Step"

After entering this command the search result is the new current object.

‘ChangeNode <NodePath>’ or ‘cn <NodePath>’

In contrast to JumpToNode this supports relative paths.

Example:

> cn "TestCases"

> cn "Folder"

Based on the project root element, the first cn command turns the "/TestCases" folder into the current object, and the second cn command the "/TestCases/Folder" folder.

In addition you can use cn to access the superordinate object more quickly.

> cn ..

'Search <queryString> <resultNum>'

This command is mainly intended for the interactive mode and enables to navigate via various search results even if several objects are returned as search results.

<queryString> is a TQL query string

<resultNum> is the index of the object in the result list to which the system should jump, or '0' if the current object should not be changed.

Marked objects and drag & drop tasks

For certain operations (e.g. drop tasks) you can use any number of objects as arguments, e.g. to move a set of TestCases into another folder.

These actions and the creation of new TestSteps on the basis of Modules would usually be performed in Tosca Commander™ by using drag & drop.

To provide these options also in the TC-Shell, there are following commands available to mark and dropmark objects or for activating drop tasks:

Mark objects and drop tasks

'Mark'

The current object is added to the list of the marked objects.

'ClearMarked'

The list of the marked objects is cleared (is empty afterwards).

'DropMarked'

The relevant drop task that arises from the context of the current object and all marked objects, is performed, and the list of the marked elements will be cleared.

Example: Creation of TestSteps on the basis of three existing Modules:

> JumpToNode "/ModuleFolder/T car tariff calculator"

> Mark

> JumpToNode "/ModuleFolder/T vehicle data"

> Mark

> JumpToNode "/ModuleFolder/T person data"

> Mark

> JumpToNode "/TestCaseFolder/Tutorial/Automated TestCases/MyTestCase"

> DropMarked

'DropMarkedWithCtrl'

The action 'DropMarked' is performed with the Ctrl key pressed (copy==True).

Executing tasks

Actions in Tosca Commander™ are called and performed depending on the environment you are working in. The available options are those, which are possible for the selected elements.

In the TC-Shell these context-based operations are called tasks. They can be performed with the command task.

TC-Shell tasks

Command

Description

task

Provides a numbered list of all available actions. The names of the actions correspond to the context menu entries in Tosca Commander™.

task <taskNum>

This calls an action by using its number. Run the task command to view a list of valid numbers.

task <taskName>

This calls an action by using its name. Run the task command to view a list of valid names.

Example: >task "Create TemplateInstance"

According to their flow, tasks require additional entries from the user, e.g. file or directory paths, the entry of strings, the confirmation of actions, etc. The user has to provide all required information.

In the interactive mode the required information is written to the prompt (command line). In the script mode, the corresponding information must be indicated in the script file.

Example

Create a TemplateInstance to a TestCaseTemplate:

jumpToNode "/TestCaseFolder/SampleTestCases/Generated

TestCases/CheckCarInsur"

task "Create TemplateInstance"

// *** Input to "Create TemplateInstance"-Task

// DataSourcePath including Sheet =

"C:\\Projects\\ToscaTutorial\\BO_TC\\TC_catalog_web.xls\\TC_RS"

// Instantiation Selector =

"The first 10 hits"

// *** End of Input to "Create TemplateInstance" Task

Call other scripts

In the interactive mode and the script mode, script files can be accessed by using the Call command.

TC-Shell call

'Call <scriptPath>'

The path to the script file can be specified absolutely or relatively to the requested script.

The current object remains the same current object as at the time of the call.

Iterations on objects

In order to perform operations on a large number of objects the following commands exist:

TC-Shell iteration

'For <queryString> CallOnEach <scriptPath>’

A script is called up for every object in the result list of the TQL query.

In this case the respective object becomes the current object for the script call.

'For <queryString> MarkAll'

All objects of the result list will be added to the list of marked objects.

'For <queryString> TaskOnEach <taskName>'

The task will be called up for every single object of the result list.

In this case the respective object becomes the current object for the script call.

'For <queryString> TaskOnAll <taskName>'

The task will be called up once for all objects of the result list. This is possible only for multi-selectable tasks.

Example: Disable several TestSteps, whereas a reason only has to be given ONCE.

> For "=>Items:Test Step[Name==\"calculatePremium \"]" TaskOnAll "Disable"

> // Disable-Reason for all

> "Module is going to be reorganized"

Multiuser mode

In multiuser environments objects must be checked out prior to modifying them. To do this, the task Check out can be activated at the particular object.

To check all modifications into the common repository, or to transfer the latest state from there into the local workspace, the following commands are available:

TC-Shell Multiuser

'checkinall'

All objects that the user checked out from the workspace will be checked into the common repository. In the subsequent line/step, this comment requires an input.

'updateall'

The local workspace will be updated to the current state of the common repository.