PreviousYear 2000 Testing Testing Application OutputNext"

Chapter 29: Session Recording

WinRunner 2000 is one of the optional extensions in Mainframe Express. This chapter covers its basic features by demonstrating how to use it to create and run a test. It leads you step-by-step through the creation of a project and then shows you how to create a WinRunner 2000 test, record a script, replay the script by running the WinRunner 2000 test and analyze the results.

You need to have read the chapter Start Here for the Tutorials and worked through the first session, Using Mainframe Express, before you do this session.

You need to have installed WinRunner 2000 to do this session.

Note: This tutorial uses the Microsoft application, Calculator, to demonstrate the basic features of WinRunner 2000. The Calculator application is normally installed as calc.exe in your Windows 95, Windows 98 or Windows NT installation directory.

29.1 Overview

WinRunner 2000, a session recording tool from Mercury Interactive Corporation, is an automated testing tool for mainframe applications that has been incorporated into Mainframe Express.

The Micro Focus WinRunner 2000 automated testing tool uses Mainframe Express to execute mainframe applications on the PC. The same test scripts can then be re-used to execute the application on the mainframe via 3270 emulation.

Before attempting to use WinRunner 2000 you need to understand the following terms:

WinRunner 2000:

29.2 Creating a Mainframe Express Project

You can run WinRunner 2000 by selecting WinRunner 2000 and then WinRunner 2000 from the Mainframe Express Tools menu but before you can use the integrated WinRunner 2000 to perform any kind of testing on your application, you must create a Mainframe Express project:

  1. Start Mainframe Express and click New on the File menu, then select Project on the New dialog box and click OK.

  2. Enter WinRunner as the name of the project, accept the default Project Folder, \mfuser\projects\WinRunner, then click Next.

  3. Select Using this wizard as your chosen method of creating the project and click Next.

  4. Leave the default folder for the catalog (drive:\mfuser\projects\WinRunner) unchanged and click Next.

  5. If you have installed any Mainframe Express options, a dialog box is displayed prompting you to specify which of those options this project uses. It does not use any Mainframe Express options so ensure that all the boxes are unchecked and click Next.

  6. A summary of the information that you have entered is displayed. Click Finish to create the project.

29.3 Debugging Non-Mainframe Applications

The Calculator application is a Windows, rather than a Mainframe, application. You must ensure, therefore, that you have enabled debugging of non-mainframe applications:

  1. Select Debug from the Options menu and ensure that Enable debugging of Non-Mainframe applications is checked.

  2. Click OK.

29.4 Creating a WinRunner 2000 Test

To create a WinRunner 2000 test:

  1. Click the Tests tab.

  2. Select New from the Test Case menu.

  3. Select WinRunner Script and click OK. The Define Test wizard shown in Figure 29-1 is invoked.

    Figure 29-1: Define WinRunner 2000 Test

  4. Accept the default name for the test (Test_1), enter a description of Calculator and click Next.

  5. The Define Application Start Parameters page is displayed. Application start parameters specify how your application is started and run. By default, no application start parameters are included in a WinRunner 2000 test. You can accept this default, select application start parameters from a list of existing parameters, or create new ones. To create new application start parameters click New. The Create Application Start parameters dialog box is displayed, as illustrated in Figure 29-2.

    Figure 29-2: Create Application Start Parameters

  6. Enter a name of Calculator and a description of MS Calculator and click OK.

  7. The Testcase Parameters dialog box is displayed. Click the Non-mainframe tab and enter calc.exe. Click OK.

  8. Click Next.

  9. From the Select WinRunner Script page you can select an existing script or create a new one. Ensure that New is selected and accept the default name for the script (Script_1) by clicking Next.

  10. A summary of the information that you have entered is displayed. Ensure that Record Script Now is checked (so that you can record your new WinRunner 2000 script straight away).

  11. Click Finish to create the WinRunner 2000 test and start recording your script.

29.5 Recording a Test Script

Once you have created your WinRunner 2000 test and selected to record the script, WinRunner 2000 is started in record mode and the application associated with the test (in this case, Calculator) is started using the application start parameters that you have defined.

Note: If you do not define any application start parameters for a test, but choose to record a script, WinRunner 2000 is started in record mode, but no application is started.

  1. Ensure that the Calculator application has focus by clicking on its title bar or, if you cannot see the title bar, clicking the Calculator icon on the Windows taskbar.

  2. Click 5.

  3. Click the plus sign.

  4. Click 3.

  5. Click the equals sign (=). The answer, 8 is displayed.

  6. Close the Calculator application by clicking on its button.

  7. Ensure that WinRunner 2000 has focus again by clicking on its title bar or, if you cannot see the title bar, clicking the Micro Focus WinRunner icon on the taskbar.

    WinRunner 2000 has recorded every keystroke that you have made. Your script should look very similar to this (the numbers may be different and the win_mouse_click and win_mouse_drag commands may vary):

    # Micro Focus WinRunner 2000 Template
    win_activate ("Calculator");
    win_mouse_click ("Calculator", 109, 129);
    win_mouse_click ("Calculator", 201, 204);
    win_mouse_drag ("Calculator", 162, 164, 163, 165);
    win_mouse_click ("Calculator", 239, 200);
    win_close ("Calculator");

    If, for any reason, your script contains additional keystrokes (for example, because you have been clicking on the online version of this Getting Started to check the instructions), edit the script so that it resembles that shown above and then save it.

  8. Minimize the WinRunner 2000 window by clicking its button.

  9. Click WinRunner in the left-hand pane of the Tests View in order to ensure that your test is displayed in the right-hand pane.

29.6 Test Status

The status of a test is displayed in the right-hand pane:

29.7 Running a Test

When you run a test, the WinRunner 2000 script is replayed. To run a test:

  1. Right-click on the test in the right-hand pane.

  2. Select Run from the context menu. The application associated with the test is started and the script that you recorded earlier is replayed. Notice how fast playback is.

  3. Minimize WinRunner 2000.

29.8 Analyzing Test Results

Notice that the status of the test is now shown as Pass. To analyze the test results:

  1. Right-click on the test in the right-hand pane.

  2. Select Analyze from the context menu. The WinRunner Test Results screen, shown in Figure 29-3, is displayed.

    Figure 29-3: Analyzing the Results

The WinRunner Test Results screen documents the significant events that have occurred during a test run. Notice that the test result is shown as OK.

This tutorial has covered the basic features of the integrated WinRunner 2000 - creating a test, recording a script and playing it back. For more advanced WinRunner 2000 features, try the WinRunner 2000 Tutorial.

29.9 Before Continuing

Close the project. If you want to take a break before going on to the next session, you can close Mainframe Express.

Return to the Tutorials Map in the chapter Start Here for the Tutorials and choose which session to go on to next, depending on your interests.

Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousYear 2000 Testing Testing Application OutputNext"