I have a web project having dwr calls like :
The call from javascript is
DataController.executeValidate(captureData, changeCurrentStatus);
The dwr.xml file has code like :
<create creator="spring" javascript="DataController">
<param name="beanName" value="baseAjaxTarget" />
</create>
This bean is defined in the dao-context.xml files as follows :
<bean id="baseAjaxTarget" class="com.dwr.controller.BaseAjaxController">
//properties
</bean>
I have to test this using jmeter. Now this executeValidate
method in BaseAjaxController
fires message on the active mq using jmsTemplate. So I have to run this through jmeter so that thousands of messages are fired on active mq so that I can test them out.
According to JMeter Project Main Page
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
So JMeter won't evaluate any JavaScript like browser would do. If there is a relevant HTTP Request associated with the AJAX call (most likely there is) - you can use an extra HTTP Request to mimic this call. You can put the request(s) under Transaction Controller to measure the cumulative time of both main and AJAX requests.
Another option is sending a message directly to ActiveMQ using JMeter's JMS Publisher, check out Building a JMS Testing Plan - Apache JMeter for more details on how to use JMeter for MQ testing.