< Previous | Next >

Lesson 4.3: Add keywords to a manual test script

In the previous lesson, you edited the test script, New Customer Order Test Script, by adding test data to a statement. In this lesson, you continue as the tester to create and add a keyword.
A keyword is any statement or group of statements that you can reuse in other test scripts. When a keyword is modified, all scripts associated with that keyword are updated automatically.

To use keywords in manual test scripts:

  1. If you have not already done so, log in as the tester (Userid: tony, Password: tony).
  2. First, create a keyword:
    1. Point to the Construction icon (Construction), and click All Keywords.
    2. In the toolbar, click the Create Keyword icon (Create Keywords) to open the New Keyword dialog box.
    3. In the Name field, type Classics Java Login Keyword.
    4. Click OK. The keyword shell is created.
    5. To open the keyword in the Manual Test editor, click the Classics Java Login Keyword in the Associated Script column.
    6. In the Description field, replace the text, Keyword Implementation, with Classics Java keyword for customer login.
    7. To begin typing your statements, click Click to add from the text editor. A new step is added with the default statement type as Execution Step (Step).
    8. Starting at step 1, type the keyword steps as follows, pressing Enter after each step:
      • In the Full Name field, select Trent Culpito.
      • In the Password field, type 1234567.
      • Click OK.
    9. When you have finished adding statements, click Save at the top of the page to save the keyword.
  3. Next, add the keyword to the manual test script:
    1. Return to the New Customer Order Test Case by clicking the tab.
      Note: If you do not already have the test case open, point to the Construction icon (Construction), and click View Test Cases. In the View Builder window, deselect My test cases only, and click Run. From the list, click New Customer Order Test Case to open it.
    2. From the Test Scripts section, open the test script, New Customer Order Test Script.
    3. From the Keyword View, type Classics Java Login Keyword in the text field labeled Type Filter Text. As you type, the search filters the list of existing keywords and returns those keywords that contain your search string:
      Keyword View
      Note: If you do not see Classics Java Login Keyword listed, refresh the browser.
    4. Replace the customer login steps: In the Manual Test editor, delete steps 8 through 10, by clicking the Remove Step icon (Remove) after each step. The keyword will replace these steps.
    5. To insert a new step, position the cursor in Step 7.
    6. In the Keyword view, drag the Test Script icon (Test script) of Classics Java Login Keyword to Step 7. The keyword is added to the script and marked with the Keyword icon (Keyword):
      Keyword
    7. Click Save at the top of the page to save the test script.
When you edit a keyword in the All Keywords page, all test scripts using the keyword are updated.
In the next lesson, you continue as the tester and run a test execution record.
< Previous | Next >

Feedback