Microsoft KB Archive/136309

= Microsoft Knowledge Base =

How to Use Project Files with the Suite Manager
Last reviewed: July 25, 1996

Article ID: Q136309

The information in this article applies to:


 * Microsoft Visual Test for Windows 95 and Windows NT, version 4.0

SUMMARY
Visual Test provides you with the ability to organize development files into projects. Projects contain all the associated files required to complete testing of a particular application.

By using projects, you can organize test case files to reflect different areas of functionality within the application being tested. The organization of test scenarios according to functionality makes the process of executing a suite of tests and logging the associated results much easier. This is especially true when using the Visual Test Suite Manager, which accommodates the features of project organization. This article shows you how to organize and use a project by using the Visual Test Suite Manager.

MORE INFORMATION
To organize and use a project, create the project files, and then use Suite Manager to execute the test case files and log results.

Step One: Create the Project Files
 On the Developer Studio File menu, click New. Select Project Workspace from the New dialog box, and click OK. Name the project workspace file Notepad, and click Create. A new folder will be displayed in the project workspace view. Right-click the Notepad folder, and click New. Enter NotePad1 for the Item name, and click OK. The test case file NotePad1.mst will be created and then displayed in the project workspace view.  Edit NotePad1.mst to add this code: '$INCLUDE 'RECORDER.INC'

' *************************  ' **** BEGIN TEST CASE **** ' *************************

'******* Test Case INITIALIZATION/SETUP *********

SetDefaultWaitTimeout(Timeout)

'Minimize the Visual Test window. If GetHandle(GH_HWNDCLIENT) Then WMinWnd(GetHandle(GH_HWNDCLIENT))

Run "notepad.exe", nowait

'******* SCENARIO SECTION ***********************

'*** Scenario 1: Scenario( "Notepad FileOpen" ) CurrentWindow = WFndWndWaitC("Untitled - Notepad", "Notepad", _     FW_FOCUS, Timeout) WSetWndPosSiz(CurrentWindow, 28, 26, 575, 405) Sleep(2.431) WMenuSelect("&File\&Open...")

ChildCurrentWindow = WFndWndWaitC("Open", "#32770", FW_FOCUS, Timeout) WEditSetText _id(&h480), "c:\filenotexist.txt" WButtonClick("OK")

WMenuSelect("&File\E&xit")

Scenario Cleanup 'AND HANDLING OF SCENARIO FAILURE

'File open failed WButtonClick("OK") WButtonClick("Cancel") WMenuSelect("&File\E&xit") End Scenario

' *************************  ' ***** END TEST CASE ***** ' *************************  End  Right-click the Notepad folder, and click New. Enter NotePad2 for the Item name, and click OK. The test case file NotePad2.mst will be created and then displayed in the project workspace view.  Edit NotePad2.mst to add this code: '$include 'recorder' ' *************************  ' **** BEGIN TEST CASE **** ' *************************

'******* Test Case INITIALIZATION/SETUP *********

SetDefaultWaitTimeout(Timeout)

'Minimize the Visual Test window. If GetHandle(GH_HWNDCLIENT) Then WMinWnd(GetHandle(GH_HWNDCLIENT))

Run "notepad.exe", nowait

'******* SCENARIO SECTION ***********************

'*** Scenario 1: Scenario ("") CurrentWindow = WFndWndWaitC("Untitled - Notepad", "Notepad", _     FW_FOCUS, Timeout) WSetWndPosSiz(CurrentWindow, 28, 26, 575, 405) Sleep(2.431) Play "adf" WMenuSelect("&File\E&xit") CurrentWindow = WFndWndWaitC("Notepad", "#32770", FINDWINDOWFLAGS, _     Timeout) WSetWndPosSiz(CurrentWindow, 254, 245, 266, 130) WButtonClick("&No")

End Scenario

' *************************  ' ***** END TEST CASE ***** ' *************************  End  Right-click the Notepad folder, and click New. From the combo box list, select Folder Entry Script. Enter NotePadEntry for the Item name, and click OK. The test case file NotePadEntry.mst will be created and then displayed in the project workspace view. You will not modify this file. Right-click the Notepad folder, and click New. From the combo box list, select Folder Exit Script. Enter NotePadExit for the Item name, and click OK. The test case file NotePadExit.mst will be created and then displayed in the project workspace view. You will not modify this file.</ol>

The project files have now all been created. For the second phase, you will run the scenarios by using the Suite Manager.

Step Two: Use Suite Manager to Execute Test Case Files & Log Results

 * 1) On the Developer Studio Test menu, click Suite Manager.
 * 2) On the Suite Manager File menu, click Open, and select the Notepad.vtp file. Note that the NotePad project folder opens automatically and the .mst files are listed in the test case files workspace.
 * 3) Right-click the test case files workspace of the Suite Manager (where the .mst files are listed), and click Add All. The files will now be listed in the "Suite: workspace."
 * 4) Right-click in the "Suite" workspace, and click Run All. Wait for the tests to complete.
 * 5) Once the tests have completed, NotePad1.mst will be listed in the "Failures:" workspace.
 * 6) To quickly view the reason for the failure, expand Notpad1.mst by clicking +. The scenario name and reason for failure appears. To view the details of the failure, click Log File on the View menu.

By default, the Suite Manager saves the organization of the suite files in a file called Fail.vts. You can change this option by clicking Options on the View Menu. The .vts file can be opened at a later time with the selected suites ready to run.