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:
- If you have not already done so, log in as the tester (Userid: tony, Password: tony).
- First, create a keyword:
- Point to the Construction icon
(
), and click All
Keywords.
- In the toolbar, click the Create Keyword icon
(
) to open the New Keyword dialog
box.
- In the Name field, type Classics
Java Login Keyword.
- Click OK. The keyword shell is
created.
- To open the keyword in the Manual Test editor, click
the Classics Java Login Keyword in the Associated
Script column.
- In the Description field, replace
the text, Keyword Implementation, with Classics
Java keyword for customer login.
- 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 (
).
- 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.
- When you have finished adding statements, click Save at
the top of the page to save the keyword.
- Next, add the keyword to the manual test script:
- 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
(

), 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.
- From the Test Scripts section, open the test script, New
Customer Order Test Script.
- 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:
Note: If you do not see Classics
Java Login Keyword listed, refresh the browser.
- Replace the customer login steps: In the Manual Test
editor, delete steps 8 through 10, by clicking the Remove
Step icon (
) after each step. The keyword will replace these
steps.
- To insert a new step, position the cursor in Step 7.
- In the Keyword view, drag the Test
Script icon (
) of Classics Java Login Keyword to
Step 7. The keyword is added to the script and marked with the Keyword icon
(
):
- 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.