Deleting Results Using the Windows Command Line

You can use the Windows command line to instruct the Test Results Deletion Tool to delete test results according to criteria you specify. For example, you may want to always delete test results older than a certain date or over a minimum file size.

To run the Test Results Deletion Tool from the command line:

Open a Windows command prompt and type <QuickTest installation path>\bin\TestResultsDeletionTool.exe, then type a space and type the command line options you want to use.

Note: If you use the -Silent command line option to run the Test Results Deletion Tool, all test results that meet the specified criteria are deleted. Otherwise, the Delete Test Results window opens.

Command Line Options

You can use command line options to specify the criteria for the test results that you want to delete. Following is a description of each command line option.

Note: If you add command line options that contain spaces, you must specify the option within quotes, for example:
TestResultsDeletionTool.exe -Test "F:\Tests\Keep\web objects"

-Domain Quality_Center_domain_name

Specifies the name of the Quality Center domain to which you want to connect. This option should be used in conjunction with the -Server, -Project, -User, and -Password options.

-FromDate results_creation_date

Deletes test results created after the specified date. Results created on or before this date are not deleted. The format of the date is MM/DD/YYYY.

The following example deletes all results created after November 1, 2005.

TestResultsDeletionTool.exe -Silent -Test "C:\tests\test1" -FromDate "11/1/2005"

-Log log_file_path

Creates a log file containing an entry for each test results file in the folder or test you specified. The log file indicates which results were deleted and the reasons why other results were not. For example, results may not be deleted if they are smaller than the minimum file size you specified.

You can specify a file path and name or use the default path and name. If you do not specify a file name, the default log file name is TestResultsDeletionTool.log in the folder where the Test Results Deletion Tool is located.

The following example creates a log file in C:\temp\Log.txt.

TestResultsDeletionTool.exe -Silent -Log "C:\temp\Log.txt" -Test "C:\tests\test1"

The following example creates a log file named TestResultsDeletionTool.log in the folder where the Test Results Deletion Tool is located.

TestResultsDeletionTool.exe -Silent -Log -Test "C:\tests\test1"

-MinSize minimum_file_size

Deletes test results larger than or equal to the specified minimum file size. Specify the size in bytes.

Note: The -MinSize option is available only for test results in the file system. It is not supported when working with tests in Quality Center.

The following example deletes all results larger than or equal to 10000 bytes. Results that are smaller than 10000 bytes are not deleted.

TestResultsDeletionTool.exe -Silent -Test "C:\tests\test1" -MinSize "10000"

-Name result_file_name

Specifies the name(s) of the result file(s) to be deleted. Only results with the specified name(s) are deleted.

You can use regular expressions to specify criteria for the result file(s) you want to delete. For more information about regular expressions and regular expression syntax, refer to the QuickTest Professional Basic Features User's Guide.

The following example deletes results with the name Res1.

TestResultsDeletionTool.exe -Silent -Test "C:\tests\test1" -Name "Res1"

The following example deletes all results whose name starts with Res plus one additional character. (For example, Res1 and ResD would be deleted. ResDD would not be deleted.)

TestResultsDeletionTool.exe -Silent -Test "C:\tests\test1" -Name "Res."

-Password Quality_Center_password

Specifies the password for the Quality Center user name. This option should be used in conjunction with the -Domain, -Server, -Project, and -User options.

The following example connects to the Default Quality Center domain, using the server located at http://QCServer/qcbin, with the project named Quality Center_Demo, using the user name Admin and the password PassAdmin.

TestResultsDeletionTool.exe -Domain "Default" -Server "http://QCServer/qcbin" -Project "Quality Center_Demo" -User "Admin" -Password "PassAdmin"

-Project Quality_Center_project_name

Specifies the name of the Quality Center project to which you want to connect. This option should be used in conjunction with the -Domain, -Server, -User, and -Password options.

-Recursive

Deletes test results from all tests in a specified folder and its subfolders. When using the -Recursive option, the -Test option should contain the path of the folder that contains the tests results you want to delete (and not the path of a specific test).

The following example deletes all results in the F:\Tests folder and all of its subfolders.

TestResultsDeletionTool.exe -Test "F:\Tests" -Recursive

Note: The -Recursive option is available only for folders in the file system. It is not supported when working with tests in Quality Center.

-Server Quality_Center_server_path

Specifies the full path of the Quality Center server to which you want to connect. This option should be used in conjunction with the -Domain, -Project, -User, and -Password options.

-Silent

Instructs the Test Results Deletion Tool to run in the background (silently), without the user interface.

The following example instructs the Test Results Deletion Tool to run silently and delete all results located in C:\tests\test1.

TestResultsDeletionTool.exe -Silent -Test "C:\tests\test1"

-Test test_or_folder_path

Sets the test or test path from which the Test Results Deletion Tool deletes test results. You can specify a test name and path, file system path, or full Quality Center path.

This option is available only when used in conjunction with the -Silent option.

Note: The -Domain, -Server, -Project, -User, and -Password options must be used to connect to Quality Center.

The following example opens the Test Results Deletion Tool with a list of the results in the F:\Tests\Keep\webobjects folder.

TestResultsDeletionTool.exe -Test "F:\Tests\Keep\webobjects"

The following example deletes all results in the Quality Center Tests\webobjects test:

TestResultsDeletionTool.exe -Domain "Default" -Server "http://QCServer/qcbin" -Project "Quality Center_Demo592" -User "Admin" -Password "PassAdmin" -Test "Subject\Tests\webobjects"

Note: The -Test option can be combined with the -Recursive option to delete all test results in the specified folder and all its subfolders.

-UntilDate results_creation_date

Deletes test results created before the specified date. Results created on or after this date are not deleted. The format of the date is MM/DD/YYYY.

This option is available only when used in conjunction with the -Silent option.

The following example deletes all results created before November 1, 2005.

TestResultsDeletionTool.exe -Silent -Test "C:\tests\test1" -UntilDate "11/1/2005"

-User Quality_Center_user_name

Specifies the user name for the Quality Center project to which you want to connect. This option should be used in conjunction with the -Domain, -Server, -Project, and -Password options.

This option is available only when used in conjunction with the -Silent option.

No comments: