• No results found

Enhancing the Script

In document HP Loadrunner 8.1 (Page 76-82)

The Enhancement Section has three primary steps: Transactions, Parameterization, and Content Check.

Transactions

VuGen uses the Transaction Editor to allow you to add and manage transactions directly from a thumbnail view of the script.

By default, VuGen only shows thumbnails for the primary steps in your script. To show thumbnails for all of the steps in your script, choose View >

Show All Thumbnails.

In the following example, Trans2 measures the time for the three steps:

Select Flight, Enter Credit Card, and Flight Summary.

Working with the Transactions List

The transaction list, in the right pane of the Transaction editor, shows a list of the transactions in the script. You can view a complete list of the

transactions in the script, or only those in a specific action.

To view all transactions, select All in the Action box. To view the

transactions in a specific action, select the action name in the Action box.

To show and hide the Transaction list, click the Hide or Show Transaction List button in the upper right corner of the VuGen window.

By default, the transaction list only shows transactions without errors that measure the server response for primary steps in the script. It does not show:

Non-primary steps

Client side transactions

Transactions with errors

Therefore, you might see the following caption above the transaction list:

Transactions (2 of 4).

To show the hidden transactions—the non-primary and client side

transactions—click the button adjacent to Show hidden transactions at the bottom of the transaction list. VuGen lists the hidden transactions in gray.

To hide them, click the button again.

Transactions with errors are those that do not measure any server steps, or those with illegal names. To show the transactions with errors, click the Show transactions with errors button. VuGen lists the transactions with errors in red. To hide them, click the button again.

To show the transactions for non-primary steps, you need to display all of the thumbnails. Choose View > Show All Thumbnails. The Transaction Editor shows the thumbnails of all the steps in the script and their transactions.

Defining Transactions in the Transaction Editor

You define a transaction in the Transaction Editor by marking the start and ending thumbnails.

To define a transaction:

1 Click Transactions in the Task list to open the Transaction Editor.

2 In the thumbnail area (middle pane), scroll down to the steps that you want to mark as a a transaction.

Tip: To see more thumbnails per page, click the toolbar’s Tasks button to hide the Tasks list.

3 To mark a single step as a transaction, click on a thumbnail and choose New Single-Step Transaction from the right-click menu. VuGen prompts you to provide a name for the new transaction. If you want to expand the

transactions at a later time, you can drag the transaction brackets to include additional steps.

4 To mark multiple steps as a transaction, click in the thumbnail area and choose New Transaction from the right-click menu or click the New Transaction button in the right pane.

5 VuGen shows instructions in the status area above the thumbnails:

Step 1 of 3: Select a starting point for the new transaction.

Click the thumbnail of the transaction’s first step.

Step 2 of 3: Select where the new transaction should end.

Click the thumbnail of the transaction’s last step.

Step 3 of 3: Specify a name for the new transaction.

Type in a transaction name in the bracket directly above the transaction’s first step.

To complete the transaction, press the Enter key.

To exit a transaction during the above sequence, press the Esc key.

6 To change the starting point of a transaction, drag the transaction opening bracket to a new location. To change the ending point of a transaction, drag the transaction closing bracket to a new location.

7 Repeat the above steps for additional transactions.

8 To rename a transaction, select its title in the right pane and choose Rename Transaction from the right-click menu. Type in the new name.

9 To delete a transaction, select its title in the right pane and choose Delete Transaction from the right-click menu.

Guidelines for the Transaction Editor

Follow these guidelines when creating and defining transactions in the Transaction Editor:

Transactions must begin and end within a single action—they may not extend over multiple actions.

Transaction names must be unique within your script, even between actions.

To change the starting point of a transaction, drag the transaction opening bracket to a new location. To change the ending point of a transaction, drag the transaction closing bracket to a new location.

Use the right-click menu to add, rename, or delete transactions.

You can create transactions within an existing transaction. These are called nested transactions.

Note: If you nest transactions, close the second transaction before or at the same time as you close the first one—otherwise it won’t be analyzed properly.

Parameterization

The Parameterization screen provides you with an overview of

parameterizing values in your script. It guides you through the steps of parameterization:

Locate the argument you want to parameterize

Give the parameter a name

Select a parameter type

Define properties for the parameter type

Replace the argument with a parameter

After you parameterize an argument in your script, you can return to the Enhancements step or replay the script.

Content Check

The Content Check wizard step lets you check your script for specific text or content.

Using a Text Check, you can search for a text string during replay.

Using Content Checks, you can instruct VuGen to search for server strings automatically using predefined rules, even if you don’t know the exact text that will be returned by the server.

In document HP Loadrunner 8.1 (Page 76-82)

Related documents