Simulating User Events using ClickTaleExec

When do you need to simulate User Events using ClickTaleExec?
Generally, we recommend that you use our ActivePlayback API to simulate user events.

However, in some cases, using the ActivePlayback API may not be possible. For example, if your user-events do not propagate to the ‘document’ level – you will not be able to use our ActivePlayback API.

In such cases, you can simulate user-events using our ClickTaleExec API. ClickTaleExec works in a similar fashion to JavaScript's native ‘eval’ function. It accepts JavaScript code as String, and will execute it in the playback.

This is useful when you have a lot of event handlers chained behind a ‘click’ event (for example). By using ClickTaleExec to simulate the ‘click’ event in the playback, all the chained handlers will execute as they normally would on the live page.

Code Example
The code snippet below is used to bind ClickTaleExec to the ‘click’ event for all elements with CSS class of ‘allmybuttons’. You can modify this template to your own needs simply by editing the ‘SELECTOR’ and ‘EVENT’ variables.

If you’re using Prototype.js, you can use the following snippet instead: