Stress testing for Oracle’s ADF 11g with JMeter

January 14th, 2011 | Posted by in Oracle ADF | 1 Comment

The topic of this post is to illustrate the mechanism of configuring Apache JMeter with your Oracle ADF application for stress testing. Because of the lack of a fully and detailed configuration for ADF, next I’ll present a demo Test Plan which can be downloaded HERE. More information and alternative scenarios can be found at this link.

The classically way of creating a scenario with JMeter is to configure a proxy server related to a Test Plan and to start recording specific application flows from the browser. When you’re done you can stop the recording and run the created Test Plan with the desired number of threads and looping parameters.

When considering using JMeter for JDeveloper 11g ADF applications there are some additional parameters to be configured to be sure that the response data is according to the items recorded into a test plan: jsessionId, afrLoop, javax.faces.ViewState, afrWindowId. In order to simulate different user sessions we need to capture those parameters values and to be carried when running a flow based on multiple HTTP request.

Without a properly configuration, if you add a View Results Tree listener to your Test Plan, the Response Data section won’t contain the script of the accessed page; it will contain a javascript for page redirecting where the parameters presented above are set.

...
var sess = ";jsessionid=R7MnNvWQ3jQk8Tm32vr6h9WjbdQF7ZrXZVrgwnsZJ782QGQRwz4h!1237683425";
...
query = query.replace(/_afrLoop=\d*/, "_afrLoop=2530627673795511"); 
...

In order to configure JMeter with your ADF application the first step is to create User Defined Variables via your Test Plan for each parameter presented above.

The next step is to configure Regular Expression Extractor for each variable to be set up after recording a session with JMeter and to be used for simulating different HTTP requests related to the current session state:

1. jsessionId extractor

2. afrViewState extractor

3. afrLoop extractor

4. afrWindowId extractor

Any path that makes reference to the current session must point to the extracted jsessionId variable. Also, if any of the others parameters appears in the URL request, they must be substituted with the correspondent extracted values.

Also it is important to configure properly the HTTP Header Manager according to each request (to specify the parameters presented in the attached demo file).

If you want for test threads to pass application’s security (in a form based like ADF security), you must configure the j_security_check HTTP request and specify the values for the j_username and the j_password send parameters with the request (method POST).

Oracle JRockit Mission Control can be used for monitoring runtime parameters(e.g. memory, threads) or memory leaks according to different running Test Plans. According to your needs, you can use many listeners from JMeter for test monitoring or assertions to verify response conditions.

Tags: , , ,

One Response to “Stress testing for Oracle’s ADF 11g with JMeter”

  1. santh says:

    Application ADF:10.3.4 (standalone server)
    Steps:I have used Regex Extractor for jsessionId,afrLoop,afrWindowId,javax.faces.ViewState.

    while recording I did n’t get Unique parameter so I not it and I have not set isScriptRedirect.

    Clarification 1:I have record my web application through jmeter but while record itself the some actions are not captured in JMETER e.g I have entered a Order details and then I clicked ‘SAVE’ button.It does not generated the number of that Order after that I have clicked the another link which is connected to the backend and moment when I clicked the link (I got that generated number for that order and I ensure that the record was present in the DB)and Logout from application and then
    i try to run the application for multiple threads(50 Virtual users as a result I cannot see the multiple records in the DB).Could anyone please give me suggestion to solve this issue?

Leave a Reply