Process Operations

The folder TBox Automation Tools->Process Operations in the Standard subset contains the Module TBox Start Program.

This Module allows you to open an application or an executable file stored in a Microsoft Windows® file system. You can also use it to shut down an application via command line (see example 5).

It has the following ModuleAttributes:

Attributes

Attribute

Description

Path

Path to the application that you want to open or an environment variable. To shut down an application, enter the name of the command line task.

This entry is mandatory.

Directory

Specify a working directory for the program. By default, Tricentis Tosca uses the home directory of the registered user: C:\Documents and Settings\<user name>.

Arguments

If you want to start or stop the application via arguments, specify arguments.

Arguments->Argument

Define an argument and use ActionMode Input.

To shut down an application, one of the arguments must be its name according to the Details tab in Windows Task Manager.

You can specify multiple arguments, one per sub-ModuleAttribute.

WaitforExit

You can instruct Tricentis Tosca to wait until the application has been exited. To do so, set the value True and use ActionMode Select.

Optionally, specify StandardOutputFile, TimeoutForExit, and ExitCode.

WaitforExit->StandardOutputFile

If you want Tricentis Tosca to create a log, specify the path and name of the log file.

The log includes standard output (stdout) and standard error (stderr).

WaitforExit->TimeoutForExit

Specify the maximum time in seconds that Tricentis Tosca should wait before exiting the application.

WaitforExit->ExitCode

Verify your application's exit code. To do so, enter the code into the Value column and use ActionMode Verify.

Run as

Define which domain or local user credentials Tricentis Tosca should use to open the application.

By default, Tosca Commander chooses ActionMode Select.

Run as->Username

User Principal Name (UPN) format of the user name that should open the application.

For example: jdoe@company.com.

Run as->Password

If needed, specify the password of the user.

Example 1

In this example, you start the application Notepad.exe, which is located at C:\Windows.

To do so, Tricentis Tosca uses the user credentials of John Doe as specified in Username and Password.

Example 2

In this example, you open the file Test01.xml, which is located at D:\, with the program notepad.exe, which is located at C:\Windows.

The defined working directory is C:\Temp.

Example 3

In this example, you start Google Chrome and open the website www.tricentis.com in private mode:

Example 4

In this example, you start TCShell.exe, which is located at %COMMANDER_HOME%.

Additionally, Tricentis Tosca performs the following actions:

  • Waits until the application has exited

  • Verifies the application's ExitCode: 0

  • Creates a log file named log.txt and saves it to %TEMP%

Example 5

In this example, you use the Windows command line task TaskKill (link opens in new tab) to shut down Chrome, forcibly and immediately.