IBM Support

Steps to Create a Visual Basic Test script

Troubleshooting


Problem

This document describes how to create and run a Microsoft® Visual Basic® (VB) test script in IBM® Rational® TestManager. It gives an example of a simple script. This document serves as a supplement to the documentation of the test script services for VB. You can find an electronic version on a computer with TestManager. Click from the Windows® Start button, then click: []> Programs > Rational Software > Rational Test > API > TSS for Visual Basic[]. You need the integrated development environment (IDE) Visual Studio 6.0 to create the scripts.

Resolving The Problem

The instructions below guide you to create a VB test script P1. The folder where you will store the script will be:

<project>\TestDatastore\DefaultTestScriptDatastore\TMS_Scripts\vb

This test script writes the message "It works!" in the TestManager log.

First, create two subfolders, Subfolder #1 and Subfolder #2:

  1. <project>\TestDatastore\DefaultTestScriptDatastore\TMS_Scripts\vb
  2. <project>\TestDatastore\DefaultTestScriptDatastore\TMS_Scripts\vb\exe

Start Visual Basic 6.0.

  1. Create a new ActiveX DLL project.
  2. Save the class and the project as P1.
  3. Add a reference to TestServices 1.0 to the project. From the Project menu, choose References... .
  4. Implement ITestInterface by editing P1.cls. Paste the contents of the file class.txt. You will find this file attached to this document.
  5. Create a module P1.bas and paste the contents of the attached module.txt.
  6. Save the project and save all files as P1.*. For example P1.cls, P1.vbp, P1.bas.
  7. From the Project menu, choose P1 Properties... .
  8. In the dialog box Project Properties choose the Make tab; then change the field Title from P1 to MASTER_P1.
  9. Then choose the Component tab and click No Compatibility.
  10. From the File menu, choose Make P1.dll... .
  11. In the dialog box Make Project save it as MASTER_P1.dll in the \exe subfolder.
  12. Click OK to close.
  13. From the File menu, choose Make MASTER_P1.dll... .
  14. In the dialog Make Project save it as P1.dll in the \exe subfolder.
  15. Close VB and save the project if VB prompts you to do so.


Check that Subfolder #1 has the following files:

P1.bas
P1.cls
P1.vbp
P1.vbw

And that Subfolder #2 has the following files:



MASTER_P1.dll
MASTER_P1.exp
MASTER_P1.lib
P1.dll
P1.exp
P1.lib
P1.msg

Start TestManager

  1. From the Tools Menu, choose Manage > Test Script Types.
  2. In the dialog box Manage Test Script Type; choose VB Script; then click Edit... .
  3. In the dialog box Test Script Type Properties choose the Sources tab, then click Insert... .
  4. In the dialog box New Script Source type "Demo" in the text box Name.
  5. Choose the tab Connection Data and browse to select the folder where you saved the P1.vbp file.
  6. Verify that the connection options are as follows:
    Default datastore = 0
    Type = VB

  7. Close all dialog boxes with OK or Close.
  8. Open the Test Scripts View. From the View menu, choose Test Scripts.
  9. Right-click on P1; then choose Run... .
  10. Wait until TestManager displays a log.

In the log details window right-click the event with label Message. Verify that TestManager logged the message "it works".


Note: If you modify your VB project, you will need to make the P1.dll only. But you will still need the MASTER_P1 files under the \exe directory.



class.txtmodule.txtclass.txt
[{"Product":{"code":"SSSHVH","label":"Rational TestManager"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Not Applicable","Platform":[{"code":"PF033","label":"Windows"}],"Version":"2003.06.12;2003.06.13;2003.06.14;2003.06.15","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

More support for:
Rational TestManager

Software version:
2003.06.12, 2003.06.13, 2003.06.14, 2003.06.15

Operating system(s):
Windows

Document number:
78709

Modified date:
16 June 2018

UID

swg21179543