Starting stubs: HCL OneTest API method

HCL OneTest™ API can be used to start stubs, but HCL Quality Server provides more control over the startup of a stub or a set of stubs.


To start a stub:

  1. In HCL OneTest API’s Test Lab perspective, find the stub that you want to start.
  2. Right-click the stub and click Run on the shortcut menu.

    Alternatively, select the stub and click Run on the Task Monitor window’s toolbar.

    Note: If you want to run all stubs for a particular operation, right-click the operation’s Stubs folder and then click Run All > Stub on the shortcut menu.


Starting a message-based stub causes the following things to happen:

  • The Test Lab perspective’s Console window displays progress of the stub’s startup and messages from the stub as it runs. If the stub’s log level has been set to Debug, you will be able to view detailed information about what the stub is doing. (For information about setting a stub’s log level, refer to Starting stubs: HCL Quality Server method.)
  • The stub will start listening on queues and ports.
  • If proxies are being used, traffic will be routed to the stub automatically.
Note: For information about restrictions on stubs started by HCL OneTest API, refer to Starting stubs.

Starting a database stub causes the following to happen:

  • The data contained in the stub is loaded into the simulation database.
  • The HCL OneTest API JDBC proxy is switched to simulate mode, which affects the system under test but not HCL OneTest API, and all interactions between the system under test and the live database are directed to the stub. (For information about simulate mode, refer to Creating and modifying database stubs.)
  • The Test Lab perspective’s Console window displays progress of the stub’s startup.
Note: If you are using HCL OneTest API 8.0.1 (or later), clicking default case console output or failed validation console output on the Console window opens the Message Differences window, which enables you to debug the stub. (For information about debugging a stub, refer to Debugging Message-Based Stubs. For general information about the Message Differences window, see HCL OneTest API reference.)