Share this page

# Record scripts

This topic describes how to record user actions interactively into a TruClient 2.0 script.

Note: Mozilla Firefox recording is supported as a Beta release.

In this topic:

## Create and record a script

The following steps describe how to create and record your script.

To record a script:

1. Create a new TruClient 2.0 - Web script in VuGen.

   The new script opens in the VuGen Editor pane.

2. If required, configure runtime settings for the script. Select Replay > Runtime Settings.

3. In the VuGen toolbar, select the browser to use from the Select Browser dropdown list. The browser must be installed on your local machine.

4. In the VuGen toolbar, click Develop Script. The TruClient Development window, and the Application browser window containing your selected browser, are both opened.

   For user interface details, see Development window.

   Tip: For a list of known issues with Firefox, see Mozilla Firefox browser.

5. Start recording your script:

   - Use the Record button in the Development window to begin recording. You can stop recording at any time by clicking the Stop button.

   - You can create new actions to record into, in addition to the default Action section. Select the action from the Action dropdown list and click Record. For details, see Script actions.

   - Begin performing your business process in the browser window. All of the actions are recorded and displayed in the Development window as steps.

   - After stopping the recording, you can restart recording from where you stopped. Alternatively, you can record new steps at a location in the script. Right-click a step and select Record > Before step or After step to record new steps into that location of the script.

     If you are recording into a group step, select Record > Record into. For details on setting groups, see <Groups>.

6. Click Save.

7. If required, modify the run logic. Run logic determines the flow of your script, meaning the order in which actions run during a test, and the number of times they run. For details, see Run logic.

8. Click the Replay button to replay the script. You must replay your script at least once from the Development window, so that the engine can perform some background tasks. For details, see Replay scripts.

   You can view replay progress in the status bar at the bottom of the Development window.

9. Enhance your script by adding manual steps, parameters, functions, and so forth. For details, see Enhance scripts.

## Include file upload in your script

Your business process may include the selection and upload of one or more files. After recording this process, you must edit the file paths for successful replay.

To upload files in your script:

1. Record the file upload as part of script. You can select multiple files.

2. The file upload is generated as a Set <files> on <object for action> filebox step. The Path argument contains only the file names of the selected files.

3. Edit each file name to include the full file path. Make sure that each reference file remains separated by a semicolon ";".

4. Replay the step to check it works as expected.

   Note: You can also manually add a Generic object action step to your script, and choose a filebox object for the step. You then set the full file paths in the Path argument.

## 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.

## Recover a script after a crash

Note: Supported from version 26.3.

If TruClient detects that the application was closed due to an unspecified error, it stores the last known state of the script in a temporary folder. When you try to reopen the script, the Recover script window opens, indicating that TruClient did not shut down correctly.

Choose one of the following options:

- Revert: Load the last saved version of the script.

- Restore: Restore the script from its last known state. This action will overwrite the last saved version and cannot be undone.

## See also

- Script actions
- Known issues for TruClient 2.0
- Working with TruClient 2.0

https://admhelp.microfocus.com VuGen,Professional Performance Engineering,Performance Engineering for Developers 8942
Tips to improve your search results... OpenText™ Virtual User Generator Help Center OpenText™ VuGen Help 26.1-26.3 All View Local Help Center View Online Help Center Version: