Running a script from HCL OneTest UI

You can run test scripts from HCL OneTest UI to play back all your recorded actions. The playback of the recording can include the actions that you performed to start and stop an application, to add verification points, and the actions you performed while using the application.

Before you begin

On the Windows operating system, you must start HCL OneTest UI as an administrator if you have an application under test (AUT) that is configured with a different user credential. See Recording scripts for an AUT with different user credentials.

About this task

You can play back functional tests in Google Chrome, Microsoft Edge, Firefox, and Internet Explorer. When you play back any HTML test in the Edge or Chrome browser, if there is a browser and driver incompatibility, HCL OneTest UI automatically downloads the appropriate driver. The test is then played back successfully.

Procedure

  1. Configure your application for testing by setting the appropriate Java environment or web browser to run the application.
  2. Run the script in any of the following ways:
    • In the Projects view, click a script and click Run Functional Test Script Run Functional Test Script button in the HCL OneTest UI toolbar.
    • In the Projects view, right-click a script and click Run.
    • In the Projects view, click a script and then click Script > Run.

    The Script Launch Wizard is displayed.

  3. Optional: To prevent the Script Launch Wizard from opening when you run a test script, perform the following tasks:
    1. Click Windows > Preferences.
    2. Click Functional Test > Playback > Logging.
    3. On the Logging options page, select Don't show script launch wizard.
  4. On the Select Log page, keep the default log name or select a log name.
  5. Optional: You can enter run arguments or set a dataset iteration count:
    1. Click Next to display the Specify Playback Options page.
    2. In the Run arguments field, enter or select command-line arguments to pass to the script if required.
    3. In the dataset Iteration Count field, select a number or Iterate Until Done to specify the number of times a test script can run when you run the script.
  6. If the unexpected window handling feature has been enabled for all scripts in the Preferences dialog box, the Enable handling of unexpected windows check box is selected on the Select Log page. Clear the check box if you do not want to enable the feature for the script you are running.

    If the unexpected window handling feature has not been enabled for all scripts in the Preferences dialog box, the Enable handling of unexpected windows check box is not selected. Select the check box if you want to enable the feature for the script you are running. Actions that have been configured for specific controls on unexpected windows in the Configure Handling of Unexpected Windows dialog box are performed.

  7. If the dynamic find feature has been enabled for all scripts in the Preferences dialog box, the Enable script find if scoring find fails check box is selected on the Select Log page. Clear the check box if you do not want to enable the feature for the script you are running. The dynamic find feature enables HCL OneTest UI to locate test objects in the application-under-test whose hierarchical position may have been altered from the position in the test object map, ensuring that playback does not fail.

    If the dynamic feature has not been enabled for all scripts in the Preferences dialog box, the Enable script find if scoring find fails check box is not selected. Select the check box if you want to enable the feature for the script you are running.

  8. Click Finish to begin running a test script.

Results

The Playback Monitor starts and provides information as the script plays back. If the Playback Monitor does not start, check the settings in the Playback Monitor Preferences Page.

After the script runs, a log file opens. If a log does not open, in HCL OneTest UI, check the settings in the Logging Preferences Page.

Notes:
  • When running test scripts through command-line or through UrbanCode Deploy, you should ensure that at any given time, only a single playback process is running on the machine hosting HCL OneTest UI.
  • If the recording was performed in one document mode on Internet Explorer, the play back needs to be done on the same document mode in Internet Explorer. Using different document modes may render the controls differently and playback may vary.
  • For information about providing more granular control of mouse and keyboard actions, see Playing Back Low Level Mouse and Keyboard Actions.
  • For information about pausing or stopping script playback, see Pausing or stopping script playback.