Access Keys:
Skip to content (Access Key - 0)
Log in (Access Key - 5)



Toggle Sidebar

waitForAjax-action-moly

API Doc

waitForAjax (method, requestURI)

(Molybdenum-only)

Checks whether an XMLHttpRequest with the given params has returned with readyState 4
and all Javascript onreadystatechange listeners have been invoked.

Any DOM modification should have taken place by now.

@since 0.7.1
Arguments:

  • method -
    either GET or POST
  • requestURI -
    the URL

This is how molybdenum behaves in record mode as well as in run mode for each and every Ajax request:

  1. wait for readystate 4
  2. let the browser invoke the javascript callback handler of the application under test
  3. handle the ajax request in molybdenum:
    1. In run mode, the associated Ajax request and its target url is being stored in memory.
      Any waitForAjax command interpreted later on will wait for this queue to contain the specified request (at least one request that matches the given method and url).
    2. In record mode, the command "waitForAjax" with the recorded method and target url will be inserted in the testcase.

Record mode:

The run mode is simliar: instead of the waitForAjax command to be inserted, the Ajax request is added to the in-memory queue. Any waitForAjax command waits until this queue contains the request specified or molybdenum times out:

last edited on Apr 06, 2009 22:25
Adaptavist Theme Builder Powered by Atlassian Confluence