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
Procedure
- Open the ivory.properties file available at: <Rational® Functional Tester installation 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
Procedure
- Open the ivory.properties file available at: <Rational® Functional Tester installation 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 ()
, orWaitForAjaxCompletedRequests ()
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.