Running a test case

If you have not created a test case execution record for a test case yet, you can run the test case directly and you can associate the test execution results with a particular test plan.

About this task

When you run a test, the Quality Management application runs a test case execution record. If you have created test case execution records for a test case that you want to run, you initiate the test run from a test case execution record. If you have not created test case execution records for a test case (and do not want to), you can initiate the test run from the test case. When you initiate a test run from a test case, you define the test case execution record in the Run Test Case dialog box by selecting a test plan, iteration, and test environment to associate with the test run.

Procedure

  1. From an open test case, click the menu arrow next to the Run icon Run and select Run to open the Run Test Case dialog box.
  2. Select values in the Run Test Case dialog box.
    1. In the Test Case Execution Records list, select an existing test case execution record, or accept the default option, New Test Case Execution Record, to create a new execution record. If you choose to create a new execution record, select values in the Test Plan, Iteration, Test Environment, and (if enabled) Channel fields.
      Remember: Channels are subsets of Test Environments. Listed channels depend on the selected Test Environment.
      Note: If you have an existing execution record that uses the values you specify for the test plan, test iteration, and test environment, the existing execution record is used and a new one is not created.
    2. In the Test Script list, select a test script.
    3. If you selected an automated test script, set the following values.
      1. In the Machine list, select a specific test machine on which to run the test.
      2. If you want to schedule the test case to run at a future time, select Schedule Execution and choose a date and time.
    4. To associate the results of this test run with a build record, click the Change Associated Build icon Change Associated Build and select a build record. The test case result from this test run is automatically linked to the build record that you choose.
    5. To record a result for this test without executing the script, select Create Result without Execution and then, in the Set Verdict of the Result aslist, select a value.
    6. To override the values of execution variables defined in your test case and test script, click Modify Execution Variable Value(s). Then, in the test case and test suite variables lists, type the value that you want to assign to each variable.
    7. To select records in test data that are associated with the test script, select Select Records from Test Data, click Next, and then select records that you want to use during the test run.

      You can adjust values in the Record Selection Criteria section to show a subset of the test data or clear the fields to show all records. Records that you select at run time override the record selection criteria that is set in the test case or test script.

  3. Click OK or Finish to run the test case.
    The script execution window opens and an arrow points to the first statement.
    Note: If an automated test script is associated with the test case, select the appropriate adapter to run the test, and then click OK. The script execution window opens, and the test runs automatically. At the end of the test run, the adapter attaches the tool-specific result to the Result Details section of the test case result.
  4. For each step, follow the instructions in the step and then and assign a verdict to the step.

    Possible verdicts include:

    • Pass Pass
    • Fail Fail
    • Inconclusive Inconclusive
    • Blocked Blocked
    • Error Error
    • PermFailed PermFailed
    • Deferred Deferred
    Note: To see the options for Blocked, Error, PermFailed and Deferred, click the arrow next to the Inconclusive icon Inconclusive.
    Tip: To assign one verdict to the current step and all subsequent steps, click the Apply All icon Apply all verdict, select the verdict that you want, and then click OK.
  5. Optional: Type the step results in the Actual Results field.
  6. Optional: Add a comment to one or several statements:
    1. From the toolbar, click the Comments icon Comments.
    2. Type your comment in the Write Comments field, and click OK. The Comments icon Comment is displayed in each statement that has a comment.
  7. Optional: Add an attachment to one or several statements. For example, you can create a screen capture of the application under test and attach it to the statement. To attach a file to a statement:
    1. From the toolbar, click the Attachments icon Attachments. The Attachments View window opens.
    2. Browse to the file, and click Open.
    3. Click OK. The Attachment icon Attachment is included within each statement that has an attachment.
  8. Optional: Add an image directly to a result by clicking the Insert Image (Insert image) or Capture Screenshot icons.
  9. If you discover problems with the application under test, submit a defect:
    1. From the toolbar, click the Create New Defect icon Create new defect. The defect form opens.
      Note: If you configured Rational® ClearQuest® as your defect provider and you are using Internet Explorer, you might see a Security Warning dialog box when you attempt to create a defect. To allow the defect form to open, in Internet Explorer 7 click Yes, or in Internet Explorer 8 click No.
    2. Complete the defect form, and click OK. The Defects icon Defect is included in each statement that has a defect.
  10. When the test run is complete, click Show result to view the test case result.
  11. Update the test case result as required, and click Save to save your updates.

    For example, you can modify the Actual Result value, provide a detailed description in the Notes section, or modify the weight distribution in the Weight Distribution section. After you edit, be sure to click Save to save your changes.

    Note:

    To change the Actual Result value in a test case result, you must have the Save Test Case Result: Edit Actual Result permission.

    The Result Details section varies with the type of test script that you run. For manual test scripts, the Result Details section includes a bar chart of step results, followed by the script steps with results. You can add comments to the script steps in this section.

    To attach or remove a file from a step in the Result Details section, click Edit and then click the Attachments icon.

What to do next

To view the test case result at a later time, in the main menu, click Execution > Browse > Test Case Results.


Have a problem or a question? Post it in the Jazz.net forum.