Script actions

You manage your script actions in the TruClient Development window Actions view.

About actions

An action is a set of steps that represents a business process, or part of one. A business process can be very short and specific, like logging in, or larger, like a sequence that starts with a search and ends with a purchase.

The steps for an action can be added during the recording process, or manually added from the Steps box.

There are three default actions in a script: Init, Action, and End. These default actions cannot be deleted or renamed.

Default action Usage
Init

The init stage is when the Vuser is initialized (loaded) for a test.

You have the option to add an opening sequence of steps, which will run once for each replay. For example, you might add the login to an application.

Action

Add the steps that the Vuser performs to test the business process. The steps are run as a sequential set, and can be run multiple times. For details, see Run logic.

End

The end stage is when the Vuser finishes the test or is stopped.

You have the option to add a closing sequence of steps, which will run once for each replay. For example, you might add a logoff procedure.

You create and run actions in the Actions view. From this view, you record and replay your script.

Before recording, you can select a section of the script, and the recorded step are inserted into that section. You can record your entire script into the default Action, or you can create new actions that represent different parts of your business process.

Note: Do not modify or delete the Actions container for the script in VuGen's Solution Explorer pane.

Back to top

Add new actions to a script

Use the Manage actions dialog box to add and delete actions in your script.

To manage actions:

  1. In the Development window Actions view, click the Manage actions button manage actions.

  2. Perform the required activity:

    • Use the Add action button to add a new action. The new action is added with a default name.

    • Double-click on the name of an added action to rename it. The added actions are organized alphabetically.

    • Use the Remove this action button to delete an action. The action is immediately deleted from the script, along with any steps it contains.

  3. Click OK. If you created new actions, the last one you added is automatically opened in the Actions view.

Back to top

Working with large scripts

When working with large scripts (those with a few hundred steps), it can be difficult to edit the script because of the time it takes to add, delete, locate, or replay selected steps.

To minimize or avoid these issues:

  • Divide the script logic into multiple actions and functions, where each action does not have more than 50 steps.

  • Give meaningful names to actions and functions.

  • Add comments in the script to help you find specific parts in the script more easily.

Back to top

See also: