Set 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, use the 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
- Open the ivory.properties file available at: <Rational Functional Tester install directory>\Functional Tester\bin\.
- 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
- Open the ivory.properties file available at: <Rational Functional Tester install directory>\Functional Tester\bin\.
- Set the rational.test.ft.html.ajax.autotrace option to false. For example: rational.test.ft.html.ajax.autotrace = false
- 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)
- Use the GetAjaxPendingRequests (), WaitForAjaxPendingRequests (int), GetAjaxCompletedRequests (), or WaitForAjaxCompletedRequests () methods explicitly in the script to trace the AJAX requests.
What to do next
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.