Previous Topic: Tutorial 6 - Part B - Run the Test CaseNext Topic: Tutorial 7 - Test an Enterprise JavaBean (EJB)


Tutorial 6 - Part C - Modify Request Test Steps

The web recorder produces an HTTP/HTML Request test step for each request.

You can edit and modify these test steps like the other test steps in DevTest. The recorder uses the parameters that you entered during the recording as values for the Post and Get parameters in the request.

To generalize your LISA Bank test, replace these hard-coded description and deposit amount values (for example, "cash" and "1000.00") with properties from a data set. You previously worked with data sets in Tutorial 2 - Data Sets.

In the LISA Bank5 test step from the recording results, the Host Name and Port parameters are parameterized and added to the configuration. The values for description and amount are hard-coded.

In this part of the tutorial, we use a numeric counting data set to parameterize the test case so it deposits different amounts of money. When you then run the test case, it uses deposit values different from the ones recorded.

Step 1 - Copy a Test Case

Follow these steps:

  1. Ensure that the tutorial6a test case is open in the model editor.
  2. Select File, Save As from the menu bar.
  3. In the File name field, enter tutorial6c.
  4. Click Save.
Step 2 - Add a Data Set

In the following procedure, you add a numeric counting data set. This type of data set enables you to assign a number to a property. You can change the number by a fixed value each time the data set is used.

Follow these steps:

  1. In the model editor, select the first test step.
  2. In the right pane, double-click the Data Sets step tab.
  3. Click Icon - plus sign Add below the Data Sets element.
  4. From the Common Datasets list, select Create a Numeric Counting Data Set.

    The data set editor opens in the right pane.

  5. Enter the following values:
    1. In the Name field, enter DepositsDS.
    2. In the At end field, select the Execute option and select End the Test from the list.
    3. In the Property Key field, enter ds_counter.
    4. In the From field, enter 100.
    5. In the To field, enter 105.
    6. In the Increment field, enter 1.

    Sceenshot of DepositsDS data set for Tutorial 6

  6. Click the Test and Keep button to test the data set.

    You see a success message that shows the first row of data in the data set:

    Screenshot of Data Set Editor success message for Tutorial 6

  7. Click OK.
Step 3 - Modify the POST Parameters for the Recorded Deposit

You now use the ds_counter property (which you created in the data set) to specify varying amounts of money for the deposit.

Follow these steps:

  1. In the model editor, double-click the LISA Bank5 step.
  2. In the POST Parameters area, change the value of the description key to deposit {{ds_counter}}.
  3. Change the value of the amount key to {{ds_counter}}.

    Screenshot of modifying Post parameters for Tutorial 6

  4. Save the test case.
Step 4 - Stage the Test Case

To stage (or run) a Quick Test:

  1. From the toolbar, click Stage Quick Test icon Stage a quick test.
  2. In the Stage a Quick Test window, ensure that If test ends, restart it is selected.

    LISA--win_stagequicktest

  3. Click OK.

    The Test Monitor opens, but the test has not been started yet.

    Stage Test Case Current Interval Metrics window

  4. Click OK.
  5. From the toolbar, click LISA--icon_image_whiterightarrowongreen Play.

    The line graphs show the progress of the test.

    Stage Test Case Current Interval Metrics window while test is running

Step 5 - View the New Deposits in LISA Bank

Follow these steps:

  1. Log in to the LISA Bank application again with the user lisa_simpson and password golisa.
  2. To view the deposits, click the account number link for the checking account.

    Notice how the deposits start with 100 and increase by 1 until the amount 105 is reached.

    Screenshot of LISA Bank with incrementing account balance for Tutorial 6

Tutorial 6 - Review

In this tutorial, you used a numeric counting data set to provide input to the recorded test.

You: