Record scripts
Record user actions interactively into a TruClient 2.0 script.
Create and record a script
The following steps describe how to create and record your script.
To record a script:
-
Create a new TruClient 2.0 - Web script in VuGen.
The new script opens in the VuGen Editor pane.
-
If required, configure runtime settings for the script. Select Replay > Runtime Settings.
-
In the VuGen toolbar, select the browser to use from the Select Browser dropdown list. The browser must be installed on your local machine.
-
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.
-
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>.
-
-
Click Save.
-
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.
-
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.
-
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:
-
Record the file upload as part of script. You can select multiple files.
-
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.
-
Edit each file name to include the full file path. Make sure that each reference file remains separated by a semicolon ";".
-
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.
See also: