Share this page

# End events

This topic describes the application of end events in your TruClient 2.0 - Web scripts, and how to manually make changes to them.

In this topic:

## About end events

Steps contain more than one event. A step generally starts with an action, and continues with all of the events caused by the action. For example, after a click action, there might be DOM events and network events.

- TruClient scripts are asynchronous, which means that a step action does not always have to run to completion before the next step starts.

- Each step includes an End event that defines the point in the step execution at which the next step can start. When the end event occurs, the next step starts playing, while the current step continues in the background.

- After recording, the end events are not yet defined in the recorded steps, and the End event field for each step is set to Not yet set.

- During the first replay of the script, the engine automatically identifies and assigns the relevant end event for each step. For details on end event types, see End event.

- You can change the end event, if the event set automatically is not the best choice. For details, see Synchronize script steps.

## Examples of end events

Each step execution differs and may go through a different event flow, as illustrated in the following examples:

Get parameters using Evaluate JavaScript step

The step includes an Evaluate JavaScript step with `TC.getParam(name);` code. In this step there is no application related activity. Therefore, the end event is automatically set to Action completed. The remaining events in the chain are not relevant.

Click on a search box with no auto-suggest

This step interacts with the application but it does not trigger any network or DOM activity. Therefore, the end event is automatically set to Action completed. The remaining events in the chain are not relevant.

Click on a search button

This step interacts with the application and triggers both network and DOM activity. Therefore, the end event is automatically set to one of the events that comes after Action completed. The event selected depends upon the specific application behavior.

## Synchronize script steps

You may need to change a step end event when:

- The next step is not ready to be executed because the preceding end event is incorrect.

- The automatically set end events cause different results in different browsers.

- You have created a transaction that surrounds several steps. You are interested in measuring a certain aspect of the transaction more accurately. For details, see Insert transactions in scripts.

Tip: When using network-related end events in transaction steps, the End-of-network identification timeout value in runtime settings is used to identify the end of network requests. Any timeout periods are reported as wasted time. If the network is slow, and there is an end event timeout, increase the timeout value as necessary.

The process of correcting the end events is called synchronizing the script steps. You can manually set the end event to one of the predefined types.

To synchronize the script steps:

1. Replay the script from the Development window.

2. Expand each Step section and check that the assigned end event is correct. If needed, change it manually by selecting an option from the End event dropdown menu. For the menu options, see Step category.

   Note: If you change an end event manually, the change is applied for all browsers, overwriting the automatic setting.

3. Save the script and replay it again to confirm the end events.

   If the end event of a step is not reached within the defined Step timeout time (in seconds), the step returns an end event timeout error. If this error occurs, you may need to manually assign a different end event to the step that returned the error.

   You may need to replay the script several times until all steps have been accurately synchronized.

## See also

- Step properties
- Object identification
- Replay scripts

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: