Working with Test Scripts

prevnext

Creating Test Scripts


You can create a Visual Basic test script in any of these ways:


Entry Points

The entry point that you need to include in your test scripts varies, depending on whether you intend to run the script inside or outside of TestManager. For more information, see Running Test Scripts.


Registering Test Script Source Folders

If you create a test script in your IDE and manually code it, you must inform TestManager of the root test script source folder where the script is stored. To do so:

  1. Click Tools > Manage > Test Script Types.

  2. Select VB Script, and then click Edit.

  3. Click the Sources tab, and then click Insert.

  4. On the General tab, type a name for the test script source folder.

    This name is added to the TestManager File menus. You select this name when creating, editing, and running test scripts stored in the source folder.

  5. Click the Connection Data tab, and then type the full path of the test script source folder in the Data path box. This is the name of a project folder that you have created using your IDE.

  6. Type the following values into the Option name and Option value columns:
    Option name Option value
    Type VB
    Default Datastore 0

  7. Click OK. The new source folder name appears in the Sources list.


Test Script Components

A test script contains the following source file types:

Source file type Description
ScriptName.vbp Project file. You reference this file and its location from your Visual Basic IDE.
ScriptName.bas Standard module. This file initiates execution of a .cls test script file by calling the .cls file.
ScriptName.cls Class module (test script file).
ScriptName.res Resource file. This is an optional file that contains information about datapool, synchronization point, and shared variable configuration. Resource files are compiled from .rc files.

When compiled through TestManager, Visual Basic test scripts are compiled as .dll files. When compiling a QualityArchitect test script in Visual Basic, compile the test script as a .exe file.


Updating the Project File

The project file must contain specific references.

Robot automatically inserts the required references into the project file when it records a Visual Basic script.

If you are creating and coding a script manually, or if you are not using a QualityArchitect template that contains the required references, you must insert the references into the project file yourself.

To insert the references into the project file:

  1. Click Project > References.

  2. In the Available References list, select TestServices 1.0.

  3. If you are creating a QualityArchitect script, also select Rational QualityArchitect Playback Type Library.

  4. Click OK.

prevnext


Rational Test Script Services for Visual Basic Rational Software Corporation
Copyright (c) 2003, Rational Software Corporation http://www.rational.com
support@rational.com
info@rational.com