There are three main types of asynchronous request and response sequences: push, poll, and long-poll. When building a test script for a web-based application, it is essential that you understand which type of asynchronous communication is in use.
With this model of asynchronous communication, the client sends HTTP requests to the application server at a consistent rate, for example every 8 seconds. The server returns updates to the browser, thereby keeping the application updated with intermittent frequency.
With this model the browser sends an HTTP request to the application server. The server responds with an HTTP response whenever there is an update. The client generates an HTTP request to a known address on the server. Immediately following receipt of the server response, the browser sends out another HTTP request. It is the immediate response by the browser that differentiates this model from the standard polling communication model. The immediate response leads to longer wait time on the server side for a server response.
As with the polling and long-polling models, with the push model, communication begins with the browser sending an HTTP request to the application server. The response returned by the server however is kept open. This results in the browser keeping the connection to the server open. The server then sends a sub-message over the open connection whenever it has an update. With this model, communication between browser and server remains open indefinitely.
The server can close the connection at any time or keep it open even in the absence of new updates by sending ping messages that prevent the browser from closing the connection due to time-outs.