Test Design StudioGo to Previous Topic: Adding Existing FilesGo to Next Topic: Opening Project Files

Adding New Files

Add a New File

Now we want to add new files to our project. Test Design Studio uses a powerful template feature when creating new files. Templates are pre-installed for many common file types, and users can customize these pre-installed templates or even add their own templates. Templates provide you with a lot of control over how a new file is generated.

Locate the Tests sub-folder for the Walkthrough project in Solution Explorer. Under this folder, we will create a new Unified Functional Testing test. Right-click the Tests folder (#1 in the image below) and select Add -> Add New Item from the context menu (#2 and #3 from the image below).

Select Your Template

You will then be presented with the Add New Item dialog that includes templates specific to a Unified Functional Testing project.

In addition to the Unified Functional Testing Test template, you will also see templates for other common Unified Functional Testing file types such as function libraries and object repositories. Since we want to create a test, select the Test template (#1 in the image above). After selecting the template, change the name of your new test to "MyTest" (#2 in the image above) and click the Add button (#3 in the image above). The template will then be processed to generate a new test.

View Generated Content

You will notice the new file has been added to your project under the Tests folder (#1 in the image below). The new test is also automatically opened using the built-in Unified Functional Testing Script Editor (document tab is #2 in the image below).

Note:    The built-in editor does not support Keyword view found in the original Unified Functional Testing product, so you are looking directly at the script code (equivalent of Expert view).

You will notice that there is a comment header and "Option Explicit" placed at the beginning of the new test (highlighted region marked #3 in the image above). While most template systems provide static content only, Test Design Studio allows you to customize the content of your file as the template is being processed. By marking the file with certain tags (called replacement parameters), we are able to generate content for our template at the time of creation. In this example, the header includes the name of the file, the name of the person who created it, and the date of creation.

Tip:    The details of template creation and customization are not covered in this walkthrough. For those who are curious, you can look at the following file to see how the script for the new test was defined for the Test template (note the folder path differs on 32-bit operating system):
C:\Program Files (x86)\Patterson Consulting\Test Design Studio\ItemTemplates\Unified Functional Testing\Test100\Template100\Action1\script.mts
Changing this file will change the default script content for new tests that are created with the Test template.

Close the Editor

For now, close the editor for the MyTest file you just created by selecting Close from the File menu while MyTest is the active document. Perhaps the most convenient was is to simply right-click on the MyTest document tab (#1 in the image below) and select Close from the context menu (#2 in the image below). We will cover the advanced editing capabilities of Test Design Studio later in the walkthrough.

Tip:   Those with a three-button mouse can also close document by performing a middle-click over the document tab.