Docstoc

Manual Test Cases Tutorial

Document Sample
Manual Test Cases Tutorial Powered By Docstoc
					Tutorial: Creating manual testcases
Objectives
To introduce the component test perspective
To create a manual testcase
To execute a manual testcase

Time required
3 hours

Description
In this walkthrough, you will create a testcase and execute it, using the Component Test
perspective.
In this walkthrough, you will create manual testcases and execute them using the Component
Test perspective. The testcases will operate against the Web - JSP and Servlet sample
application.
You will create three testcases:

         A testcase that guides the tester through the creation of the project and initialization of
          the application.

         A testcase that guides the tester through the Form application.

         A testcase that uses the first two testcases.
This walkthrough demonstrates the features of the Component Test tool, and is not meant to be a
demonstration of the sample application being tested.

Requirements
You must have a web server running on your local machine (localhost) with the Agent Controller
installed and running. For more information on running the agent controller, see Starting and
stopping the Agent Controller.

Sample files
This tutorial recreates the project and testcases provided in the Component Test example project
Manual Test Case. After following this tutorial, you can compare your results with the example
project.
Define a project
   Open the Component Test perspective.
   In the Definition pane, click the Show directories icon.
   From the pop-up menu of the Definition pane, click New>Project.
   Select Simple and then Project as the project type.
   Click Next.
   Name the project ComponentTestSample.
   Click Finish.
   Click the Hide directories icon.

Define a host
   In the Definition pane, right-click on Hosts and click New > Host.
   In the New Host wizard, select the ComponentTestSample project and set the name to
       localhost.

   Click Finish to skip the remaining steps. The host is added to the Hosts folder.

Define the first testcase
   In the Definition pane, right-click on Testcases and click: New > Testcase
   In the New Testcase wizard, select the ComponentTestSample project and set the name to
       Create and initialize the JSP and Servlet example .

   Click Next.
   Select the Manual scheduler.
   Click Finish to add the testcase to the Testcase folder.
The contents of the testcase appear in the Outline pane. To start with, it contains a main block,
which will contain the other testcase elements.
The properties of the testcase are displayed in a properties tree and editor pane to the right.
Testcases have only two properties pages: Description, and File Attachment. Click on each of
these nodes in the property tree to see these properties of the testcase.
In the Outline pane, you can click on the main block to see its properties. It has the same pages
(Description and File Attachment), but its Description properties include information such as
Flow control type (whether the contained testcase elements are in a required sequence, or can be
performed in any order) and Iterations (the number of times the content tasks should be
performed).

Define a manual task
Now that you have created a testcase, you can add tasks to its main block.
   In the Outline pane, right-click Main Block and click New > Task > Manual. A new task
       (with the default name TC1) appears under the Main Block, and its properties are
       displayed in the properties tree and editor pane to the right.

   In the editor pane, change the task's name to Create project.

   In the properties tree, click on Design to turn to the Design page.
   In the Instruction field, provide the following instructions for the tester:
           Click File > New > Project
           Select Examples > Web, then JSP and Servlet
           Click Next, accept default values, and click Finish
           Review: two projects created in the Navigator pane

The instructions will be displayed to testers when they get to this task in the testcase.

Define a block
   In the Outline pane, right-click the main block and click New>Block. A new block is added
       to the Outline pane, and its default properties are displayed in the editor pane.

   In the editor pane, change the block's name to Initialization block.

Define more tasks
   From the pop-up menu of the Initialization block, click New > Task > Manual Task.

   Name the task Select the sample

   Turn to the Design page and provide the instruction:
       Select the index.html file in the JSPandServletExample project

Now add a second task to the same Initialization block, with details as follows:

      Task name: Start the sample

      Instruction: Right-click index.html and click "Run on Server"

Add a third task:
       Task name: Wait for the sample initial page

       Task type: Message

       Instruction: It may take a while to launch the application. The
        initial page has the Workbench logo and the title "IBM Web
        Tooling Samples Gallery"

Tasks of type message do not require the tester to perform an instruction, they just provide
information to the tester.
After creating all the tasks, close the editor for the testcase by clicking on the X in the testcase's
tab in the editor pane. When you close the editor, your work is saved.

Prepare to run
    Make sure all editor pages for the testcase elements are closed.
    In the Definition pane, right-click the current testcase and click Prepare to Run. The Prepare
        to Run wizard opens.
    Select Save instance in the definition's location.
    Click Next.
    For the host, select localhost.
    Click Finish. You are automatically switched to the Execution pane, where an instance of the
        testcase has been added.
The code required to run the testcase has been generated into the project that contains the
definition. Any further changes to this testcase's definition will not affect its instance, since the
instance code has already been generated.

Run the testcase
    In the Execution pane, right-click the testcase instance and click Run.
    In the Run wizard, accept the default execution name and click Finish.
The Remote application begins executing the testcase, and displays the testcase instructions to
the tester on the selected host (in this case, the localhost).

Complete the testcase execution
    Follow the instructions provided by the Remote Application. After completing each task,
        provide its status and any additional information, and then click Done.
    After you have completed all four tasks, close the application and return to the Component
       Test perspective.
Review the execution
   In the Execution pane, double-click on the execution instance to open it.
   Review the events logged for the execution in the Outline pane. The information should
      reflect what you provided while running the testcase.

Create the second testcase
Create a second manual testcase using the same procedure you used for the first:
   In the Definition pane, right-click Testcases and click New - Testcase.
   In the New Testcase wizard, provide the following information:

              Location: ComponentTestSample project

              Name: Form Application Test

              Scheduler: Manual
   Click Finish.
The new testcase appears in the Testcases folder.
In the Outline pane, add the following elements to the testcase's main block:

      Task

              Name:
               Start the Form application

              Instruction:
               Click the Form link on the JSP and Servlet example initial
               page. It is the second link below the "Simple Examples"
               in the left frame. On the new page, click on the "run this
               sample" link.

      Task

              Name:
               Enter the values

              Instruction:
               Enter a different value for each field of the Form. In the
               information field of the Remote application, note the
               values you used.

      Delay
              Name:
               Wait to see if the form automatically refreshes

              Interval:
               5000 ms

      Task

              Name:
               Click Submit

      Task

              Name:
               Check the values

              Instruction:
               Check if the values returned are the same as the ones you
               provided. You can review your notes for the "Enter the
               values" task by clicking on it in the Remote Application.

Prepare and run the second testcase
Prepare the testcase to run using the same options as you did for the first testcase. Then run the
testcase, complete the tasks, and review the results, in the same way you did for the first testcase.

Generate a report
The Component Test perspective lets you incorporate your own extensions for generating
reports. The sample report generator provided with the perspective demonstrates this capability,
but is not intended to be a full-scale reporting function.
Create a report to compare your executions:
   In the Execution pane, select both the testcase instances you have created so far. Use
       Ctrl+click to select the second testcase instance.
   Right-click on one of the selected testcase instances and click Report.
   In the New Report wizard, select the Testcase Execution Analysis report type.
   Click Next.
   Select the ComponentTestSample project.

   Set the report name to report.

   Click Finish. The report, a graph defined in SVG markup, is displayed in the editor pane
       using the HTML editor.
    In the HTML editor, switch to the Preview page to see the formatted graph.

Create an aggregate testcase
You can reuse the testcase structures you have defined when you create new testcases. In this
next task, you will create a testcase that sets up and then ties together the two previous testcases.
Create the testcase with an initial task:

    Create a manual testcase named JSP and Servlet Test, in the current project.

    Add a task with the title Start the product.

Incorporate the first testcase:
    In the Outline pane, right-click the main block and click Add a testcase.
    In the Add Testcase wizard, select the Create and initialize the JSP and Servlet example
        project.
    Click Finish.
Create a block to contain the second testcase, and a final task:

    Add a block named Individual Applications with a flow control type of
       Asynchronous.
    From the pop-up menu of the block, click Add a testcase and select the second testcase
       (Form Application Test).

    Add a task after the block with the title Shutdown and the instruction Close the
       internal browser and stop the current server.

If you want, you can create more testcases, one for each of the applications in the JSP and
Servlet sample. You can test them individually, as you have done here, and then add them to the
Individual Applications block of the last, general, testcase.

Summary
You have created, prepared to run, and then executed two testcases, reviewed and generated a
report on the results. You have combined the two testcases with a third testcase.


Related concepts
Component test
Component Test example projects

Related tasks
Testing manually
Creating manual testcases

				
DOCUMENT INFO
Shared By:
Stats:
views:113
posted:4/4/2011
language:English
pages:8