March 4, 2008

Integrating TestTrack TCM With Automated Testing and Scripting Tools

Application Lifecycle Management
Test Management

Helix TCM (f.k.a. TestTrack TCM) integrates seamlessly with QA Wizard Pro and QA Wizard 4.x to support automated testing. If you use another automated testing or scripting tool, you can also schedule and run automated script files through the use of a separate executable, known as a script agent, and a text file for communication between the script agent and TestTrack TCM.

About the script agent

Automated script files are run by other applications called script agents.

  • QAWAppAgent.exe, the QA Wizard 4.x script agent, is used to run QA Wizard batch files (.qawbat)
  • QAWProAppAgent.exe, the QA Wizard Pro script agent, is used to run QA Wizard Pro batch files (.qawbatch)

When you install TestTrack TCM, QAWAppAgent.exe and QAWProAppAgent.exe are installed in the ScriptAgents folder in the client applications directory. For example, in Windows the default directory is C:\Program Files\Seapine\TestTrack\ScriptAgents.

A local setting is automatically added to TestTrack TCM to set the QAWAppAgent.exe as the default application for *.qawbat files and to set the QAWProAppAgent.exe as the default application for *.qawbatch files. An entry for *.xml files to use the <Associated application> is also created so QA Wizard report files are automatically opened in Internet Explorer.

QA Wizard report files opened in browser

To use TestTrack TCM with another scripting or automated testing tool, write a new script agent to run scripts for that testing tool. The script agent also needs to be added to the ScriptAgents folder and the local TestTrack TCM options.

About the text file

A text file, named .trjob, is used as the communication mechanism between the script agent and TestTrack TCM. When you run or schedule a script file, a sub-folder is created in the ScheduledScripts folder for that file. By default, the ScheduledScripts folder is created in the TestTrack TCM client directory in Windows and Seapine home directory in Unix. This location can be changed by adding a ScheduledScriptPath key with the new path to the TestTrack client registry or .conf file.

When a script file runs, it is extracted to the sub-folder and a .trjob file is created for the script file. The result files are also added to the sub-folder. When you attach result files from a script file to a test run in TestTrack TCM, the corresponding sub-folder is also zipped and attached to the test run.

Result files attached to test run in TestTrack TCM

The .trjob file is used by the script agent to communicate the status of the script execution to TestTrack TCM. Following is the format of the .trjob file:

.trjob file format

The following name value pairs are used to associate the script file back with the test run to attach results. These values should NOT be changed by the script agent.

  • ProjectName - contains the name of the project that the script file came from
  • ProjectID - contains the project record ID
  • TestRunName - contains the summary for the test run that the script file came from
  • TestRunID -  contains the record ID for the test run that the script file came from
  • ScriptName – contains the name of the script file
  • ScriptType – identifies if the script file was a file attachment or source code file

The following name value pairs should be updated by the script agent.

  • Status – indicates script status
    Defaults to ‘Waiting’ when the .trjob file is created. The script agent should change this to ‘Started’ after it starts running the script file. The script agent should then change this to ‘Passed’, ‘Failed’, or ‘Indeterminate' after the script runs. ‘Indeterminate’ means that the script file was not successfully completed.
  • StartedOn – contains the script start date and time
  • CompletedOn – contains the script finish date and time
  • MainResultFile – contains the relative location of the main report file for the script results

Script agent source code

The QAWProAppAgent.exe is a standard Win32 application that performs the actions for running a .qawbatch file. You can download the QAWProAppAgent.exe source code files here.

The QAWAppAgent.exe is a standard Win32 application that performs the actions for running a .qawbat file.  The ScriptAgents folder also contains a QAWBatAgent.bat and QAWBatAgent.vbs file that can be used as an example.