Wednesday, December 2, 2020

JMeter an Oracle ADF 12c Test Load Tests

 JMeter is a usefull opensource product that you can use to test everything runs on the web: web application, web services and goes on.

 You can user this ool to perform load tests, discover application issue and provide a fix or be ensure that everything it's ok.

The principal thing to do is setup jmeter memory usage to avoid OutOfMemory messages. to do that you can set HEAP variable on the jmeter principal script that you can find at JMETER-HOME/bin/jmeter

: "${HEAP:="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m"}"
 
Modify -Xms -Xmx parameter as you need to increse or decrese heap usage, In my case 4g:
 
: "${HEAP:="-Xms1g -Xmx4g -XX:MaxMetaspaceSize=256m"}" 
 

Recently I 've userd Jmeter to make a load test for an Oracle ADF 12c application. With my surprise there was some configuring issue using 11g setup.

Here a link to a post that explane very well how to setup a jmeter load test and a link to Chris Muir old but valid post for 11g testing the configuration. This post is inspired by previouse links.

I 've found with Ivan a new configuration that works fine. Anyway you can find as attachment here a JMeter project for 11g version and here a JMeter project for 12c version with all settings done to test an ADF application.

To have a jmeter load test  on an ADF 12c Web App navigation you need to accomplish following 3 macro steps.

Before Recording Session

  • define a list of variables as follow:

select your scenarious (right click) ==> Add ==> Config Element ==> User defined variables

  • create some Regula Expression Extractor: 

select your scenarious (right click) ==> Add ==> Post Processors ==> Regula Expression Extractor

Here a table for Regula Expression Extractors setup and a setup example of one of those:

Name of variableRegular expressionTemplate
afrLoop([0-9]{13,17})$1$
afrPage_afrPage=([0-9]{1,3})$1$
afrRedirect_afrRedirect=([0-9]{13,17})$1$
jsessionid;jsessionid=([-_0-9A-Za-z!]{63})$1$
javax.faces.ViewState<input type="hidden" name="javax\.faces\.ViewState" value="!(.+?)">!$1$
adf.ctrl-state_adf.ctrl-state=([-_0-9A-Za-z!]{10,13})$1$
afrWindowId'(w[0-9]{1})'$1$

 
  • Below are the errors which we are going to look for. We can of course add more based on our need in specific cases.
 
  • Now let's add some listeners to the test plan. They will help us to view formatted results for the application like in graphical format. We should keep it in mind that having too many listeners may slow down the performance of JMeter.

 

Recording a Session and Setting Proxy Server

To record a session for your load test you need a add a Non-Test Elements

 select your project(right click) ==> Add ==> Non-Test Elements ==> HTTP(S) test script recorder

Configure recorder to use your scenario setting the "target controller" on the test script recorder.

When we click Start, JMeter will generate a certificate. you will then install this certificate to the browser which you will use to test. you are doing this because you want to monitor all traffic from browser to the server via this HTTP proxy server. Post successful generation of proxy, you will receive a pop-up as below.
 
 
 
You need to setup browser proxy to the global settings port of the HTTP(S) test script recorder in order to intercept navigation
 

After Recording Session 

Once you have recorded a session you need to substitute page values with oracel adf variables as suggested in the oracle video, followiiong a print screen with an example. 
You also should remove or disable all request recorded but not useful for the test: images, css, cab files... and goes on
You can group session recording pages into a recording controller for future reuse, or record session directly into the Recording controller setting the target controller as well.

 Now you can run you load test from your scenario, setting number of user(thread), the ramp, the loop configuration and clicking play!

 

 

 

 

 Enjoy with jmeter and ADF!

 

 

No comments:

Post a Comment