Setting up the environment for testing AJAX-based web applications

You can test AJAX-based applications in two different ways; by setting the Auto Trace option to true or by setting the Auto Trace option to false. If you set the Auto Trace option to false, you must use the Rational® Functional Tester APIs for AJAX in the script by manually inserting them.

Setting the Auto Trace option to true

About this task

To test AJAX-based applications with the Auto Trace option set to true:

Procedure

  1. Open the ivory.properties file available at: <Rational® Functional Tester installation directory>\Functional Tester\bin\.
  2. Set the rational.test.ft.html.ajax.autotrace option to true.
    For example: rational.test.ft.html.ajax.autotrace = true

Setting the Auto Trace option to false

About this task

To test AJAX-based applications with the Auto Trace option set to false:

Procedure

  1. Open the ivory.properties file available at: <Rational® Functional Tester installation directory>\Functional Tester\bin\.
  2. Set the rational.test.ft.html.ajax.autotrace option to false.
    For example: rational.test.ft.html.ajax.autotrace = false
  3. In the recorded script, insert the setAjaxTrace(true) method for the required Document control to trace the AJAX requests. For example, document_htmlDocument().setAjaxTrace(true)
  4. Use the GetAjaxPendingRequests (), WaitForAjaxPendingRequests (int), GetAjaxCompletedRequests (), or WaitForAjaxCompletedRequests () methods explicitly in the script to trace the AJAX requests.

What to do next

Note: During playback, if any action invokes an AJAX request, the subsequent action is performed only after the request is completed. If the AJAX request completion time is more than the script playback timeout value, use the waitforExistence() method for the Document control.