Synchronize Script Steps

This task describes the process of synchronizing steps in TruClient Scripts.

  1. Interactively record the business process.

    A step action does not always have to run to completion before the next step starts. Each step has an End Event that defines the point at which subsequent steps are allowed to start running. After the interactive recording, each End Event is set to Automatic: Not Yet Set.

  2. Identify the End Event.

    Before enhancing a TruClient script, replay the script to synchronize the steps. During the first script replay on a particular browser, TruClient will try to automatically identify the End Event for each step.

    An End Event can be one of the following:

    • Automatic: Not Yet Set. The automatic end event has not yet been determined.
    • Automatic: Timers Ended. The automatic end event whenever TruClient identifies either the setTimeout() or the setInterval() function running as part of the document load in the JavaScript code.
    • Action Completed. Step ends when its action is completed. An example of an action is a button click.
    • DOM content loaded. Step ends when the page's Document Object Model (DOM) is ready. This means that the API for interacting with the content, style and structure of a page is ready to receive requests from your application client side code.
    • Step synchronous network completed. Step ends when all HTTP requests have been completed excluding requests that are associated with open connections that are not relevant to the step. Usually, these requests are triggered by using XMLHttpRequest.

    • Document load. Step ends when the process of loading a document is completed. This means that all scripts and stylesheets have finished loading and have been executed, and all images have been downloaded and displayed.
    • Object Exists. Step ends when the end event object is visible on the screen.

      For TruClient Web and TruClient Mobile Web scripts, this end event must be selected manually in the step.

      For TruClient Native Mobile scripts, this end event is automatically identified during the first replay. For more information, see Enhance scripts in the Mobile Center Help.

    • Step network completed. Step ends when all HTTP requests have completed including requests initiated by XMLHttpRequest.
    • Dialog opened. Step ends when a dialog box is opened.
  3. Confirm the End Event.

    If there is an end event timeout failure in the second replay , you should determine if another end event should be assigned to the step that timed out. If so, replace the end event manually.

    If you change the end step manually, the change is applied to all browsers, overwriting the automatic setting. If you need a different end event for each browser and you have manually changed an end event, use an If Browser step. See Troubleshooting issues replaying a script across browsers.

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

If synchronization works on one browser but not on all, see Replaying on All Browsers.

Back to top

See also: