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:
- <project>\TestDatastore\DefaultTestScriptDatastore\TMS_Scripts\vb
- <project>\TestDatastore\DefaultTestScriptDatastore\TMS_Scripts\vb\exe
Start Visual Basic 6.0.
- Create a new ActiveX DLL project.
- Save the class and the project as P1.
- Add a reference to TestServices 1.0 to the project. From the Project menu, choose References... .
- Implement ITestInterface by editing P1.cls. Paste the contents of the file class.txt. You will find this file attached to this document.
- Create a module P1.bas and paste the contents of the attached module.txt.
- Save the project and save all files as P1.*. For example P1.cls, P1.vbp, P1.bas.
- From the Project menu, choose P1 Properties... .
- In the dialog box Project Properties choose the Make tab; then change the field Title from P1 to MASTER_P1.
- Then choose the Component tab and click No Compatibility.
- From the File menu, choose Make P1.dll... .
- In the dialog box Make Project save it as MASTER_P1.dll in the \exe subfolder.
- Click OK to close.
- From the File menu, choose Make MASTER_P1.dll... .
- In the dialog Make Project save it as P1.dll in the \exe subfolder.
- 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
- From the Tools Menu, choose Manage > Test Script Types.
- In the dialog box Manage Test Script Type; choose VB Script; then click Edit... .
- In the dialog box Test Script Type Properties choose the Sources tab, then click Insert... .
- In the dialog box New Script Source type "Demo" in the text box Name.
- Choose the tab Connection Data and browse to select the folder where you saved the P1.vbp file.
- Verify that the connection options are as follows:
Default datastore = 0
Type = VB
- Close all dialog boxes with OK or Close.
- Open the Test Scripts View. From the View menu, choose Test Scripts.
- Right-click on P1; then choose Run... .
- 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.
Was this topic helpful?
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