3.12.2. Creating Test Cases
Prev | 3.12. Working with Test Cases | Next

### 3.12.2. Creating Test Cases

Most of the time spent writing tests will involve creating and editing Test Cases.

To create a Test Case, you must have created or opened a Project (Section 3.6, “Working with Projects”).

The Test Case Browser must also be visible. If it is not visible, change to the Specification Perspective perspective and select:

Window-->Show View-->Test Case Browser.

| You can also have multiple instances of the Test Case Browser open (Section 3.9.6, “Opening the Test Case Browser multiple times”).

1. Create a Test Case by using the context-sensitive menu in the Test Case Browser:

   New-->New Test Case.

   | You can also create Test Cases with a double-click on the ”Test Cases:” root entry or on a category in the Test Case Browser.

2. A dialog to name the Test Case will appear (Figure 3.20, “New Test Case Dialog”). Because the testing approach is keyword-driven, it is important to name Test Cases meaningfully – you will be able to read your tests easily and quickly choose which Test Case you need.

   Figure 3.20. New Test Case Dialog

3. Click ”OK”.

4. This creates a new Test Case with that name in the Test Case Browser (Figure 3.21, “Test Case in Test Case Browser”).

   Figure 3.21. Test Case in Test Case Browser

Next steps
The next step is to add Test Cases from the library of Test Cases to this Test Case (Section 3.12.3, “Creating tests from the library of pre-defined Test Cases”).

You can also:

- Reuse this Test Case to form other Test Cases (Section 3.10.4, “Adding items to editors”)

- Edit its content in the Test Case Editor (Section 3.10, “Working with editors: opening, adding/deleting/renaming items, commenting, adding descriptions, extracting and replacing, reverting changes”)

- Add this Test Case to a Test Suite to be executed (Section 3.10.4, “Adding items to editors”)

- Use this Test Case as an Event Handler (Section 3.27, “Dealing with errors in tests: Event Handlers”).