Recording a script
To start recording scripts against your applications, you must first configure your test environments, configure your applications, and create a project. Under certain conditions, you can start recording scripts without preparing your functional test environment.
About this task
If you haven't done these configuration tasks, see Getting Started with HCL OneTest™ UI for the necessary steps.
When you record a script, HCL OneTest™ UI records any user actions against your application, such as keystrokes and mouse clicks. You can also insert verification points to test data or properties of any objects in your application. During recording, the verification point captures object information and stores it in a baseline file. Then during playback, the verification point captures the object information and compares it to the baseline.
Note: All Functional Test scripts use a default helper base class. You can create your own helper base class if you want to add additional methods or override the methods within RationalTestScript. For more information, see Changing the Default Script Helper Base Class for a Script.
To record a script:
Procedure
- Optionally, you can first set any recording options you may need. Click Tools > Options to access the HCL OneTest™ UI options. In the folder hierarchy, click the HCL OneTest UI folder icon to open the options. Set any recording options. Close the options when you are done.
- Click the Record a Functional Test Script button or click File > New > Add Script Using Recorder. The Add New Item dialog box opens.
- In the Add New Item dialog box, select the project you want the script to be part of. Type a name for the script.
- Click Open.
The Select Script Assets page appears. HCL OneTest™ UI will create a local object map for your script by default. If you want to use a different test object map, helper base class, or test dataset, select them from the Select Script Assets page. You can also set the dataset record selection order or change the dataset associated with the script.
- Click Finish to begin recording.
The Recording Monitor opens and the recording starts. Click the Display Help icon on the Recording toolbar in the monitor for information on the toolbar buttons and how the monitor works.
- On the Recording toolbar, click the Start Application button to start your test application. See Starting Your Test Applications for more information. (If your application is already running, you don't need to do this step.)
- Perform any actions in the application.Note: To record the action of moving the mouse over a link that has a tooltip, move the mouse over the link so that the tooltip is displayed, and press Shift. This notifies the recorder to capture the action in the script.
- If you want to record a verification point, locate the object in your application you want to test, and click anywhere in the application window or dialog box. Next, click the Insert Verification Point or Action Command button. Click the Help button in the Verification Point and Action Wizard while creating the verification point for more information on the Verification Point and Action Wizard, or see Creating a Properties Verification Point for an example of how to create one type of verification point.
- If you want to insert any features into the script, such as a call script command, log entry, timer, script delay command, or comment, click the Insert Script Support Commands button. Click the Help button in the Script Support Functions dialog box for information on script support functions.
- Close your application, if you want closing the application to be part of the script.
- When you are finished recording, click the Stop
Recording button.Note:
- For recording tips and troubleshooting information, see Recording Troubleshooting and Tips.