What is the best end event for Ajax calls?
Question ID: 105959
0
0

For example, what would be the most accurate end transaction event for a pop-up window to be loaded not including any network calls being made once the pop-up has been loaded by the browser. Likewise, for a page to be loaded.

Marked as spam
Posted by (Questions: 89, Answers: 0)
Asked on February 27, 2015 7:39 pm
83 views
Answers (1)
0
Private answer

@MHooper
There are several different end events you can use with AJAX TruClient. I have listed them all below with their descriptions.
Ajax TruClient transactions end events

Before enhancing an Ajax TruClient script, replay the script to synchronize the steps. During the first script replay, TruClient will try to automatically identify the End Event for each step. The difference between transactions end events ? (Step network complete, Document Loaded, Dialog opened...)

* Action Started - Dispatched when the action defined in the step is starting. For steps with objects (i.e. most steps) it will occur right after the object has been successfully found in the application.

* Action Completed - Dispatched when the action defined in the step is completed.

* Step network completed - Dispatched when the network activity associated with the step is completed. Ajax TruClient waits a small amount of time in order to make sure that no new requests are created after all other requests have ended. The threshold is configurable via the script Runtime Settings (default is 150ms).

* DOM Content Loaded - Corresponds to the ''domcontentloaded'' event and is dispatched when parsing of the page is completed. The event will be dispatched only if the step's action has triggered a page navigation. For more information about the ''domcontentloaded event see https://developer.mozilla.org/en/Gecko-Specific_DOM_Events#DOMContentLoaded

* Document Loaded - Corresponds to the standard ''load'' event and is dispatched when the page is completely loaded, including frames/images/stylesheets. The event will be dispatched only if the step's action has triggered a page navigation. For more information on the ''load'' event see http://www.w3.org/TR/DOM-Level-3-Events/#event-type-load

* Dialog opened - A modal dialog has opened. The dialog can either be opened from JavaScript (using the alert/confirm/prompt functions) or is an authentication dialog.

* Automatic: Not Set Yet. The automatic end event has not yet been determined.
If during the first replay, a step initiates the Object Identification Assistant to resolve object
identification, the previous step's End Event will most likely be misidentified and TruClient will
automatically reset it to Automatic: Not Set Yet

Confirming the End Event

During the second script replay, TruClient confirms the Automatic End Event and will assigned
any step's End Event that had been reset to Automatic: Not Set Yet.

If TruClient is unable to assign an automatic End Event during replay, usually due to a network
timeout, a warning message will inform you that the End Event has been reset to
Automatic: Not Set Yet.

Replay the script to automatically assign the End Event or assign the End Event manually.

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

In your case the ''Document Loaded'' end event would be the one you would want for the loading of a page.

Marked as spam
Posted by (Questions: 0, Answers: 90)
Answered on February 27, 2015 8:08 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top