Working with JMeter for Load Testing Oracle ADF UI Application

In this post, I would like to share my recent experience on how we can setup Apache JMeter™ 4.0 to test Oracle ADF 12c application. This blog mainly focuses on setting-up JMeter, creating test plan for UI application and executing the plan.

Setting-up JMeter

  • Download latest version of JMeter and install, by just unzipping, on your system.
  • Navigate to the bin folder of your installed location (Ex: C:\apache-jmeter-4.0\bin)
  • Locate jmeter.bat and start it.
P.S.: If you get any error while starting jmeter.bat complaining about missing JAR file, try to download it again using some different mirror.

Creating Test Plan

  • Start jmeter.bat. You should get a new screen with an existing Test Plan as below. In this case, I renamed it to MyTestPlan.
  • Click on Templates.
  • JMeter gives us a lot of options when it comes to predefined templates. As we are going to test UI application in our case, we will select "Building a Web Test Plan" from the drop-down and create it.
  • Once you create the template, you will get a screen as shown below. I have updated details as it was needed in my case. You can always change these settings based on your requirement.
  • If you try to expand our scenario, we will see this structure:
  • In order to test an Oracle ADF application, we will have to configure ADF specific variable like afrLoop, adf.ctrl-state, javax.faces.ViewState, etc. We will now create our custom variable. Below screens illustrate how to achieve this.


  • In order to populate these User Defined Variables, we will create Regular Expression Extractors. Below screens will show us how to create these extractors.

  • We will create one regular expression extractor corresponding to each variable we have defined under our Custom ADF Variables.
Details: afrLoop | _afrLoop=([-_0-9A-Za-z]{13,16}) | $1$ | 1

Details: jsessionId | ;jsessionid=([-_0-9A-Za-z!]{63}) | $1$ | 1

Details: adf.ctrl-state | _adf.ctrl-state=([-_0-9A-Za-z!]{10,13}) | $1$ | 1

Details: javax.faces.ViewState | <input type="hidden" name="javax\.faces\.ViewState" value="!(.+?)"> | $1$ | 1

Details: afrWindowId | window.name='([-_0-9A-Za-z!]{10,13})' | $1$ | 1

  • In order to check for errors, we will add response assertion to our test plan. 


  • 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. So, use the ones which are actually needed. 

Adding Script Recorder and Setting Proxy Server

  • Next think you want to do is adding a HTTP test script recorder. To do so, add it from Non-Test Elements. 

  • Configure recorder to use Test UI APP plan.

  • When we click Start, JMeter will generate a certificate. We will then install this certificate to our browser which we will use to test. We are doing this because we want to monitor all traffic from browser to our server via this HTTP proxy server. Post successful generation of proxy, you will receive a pop-up as below.

  • Now add this certificate to your browser. I'll be using Firefox for the test. 


That's all in terms of initial setup of JMeter for testing an ADF UI application. This blog is inspired by the ADF Insider video of Chris Muir. Please visit the link for more information on how you can configure the test plan for further load testing.


Comments

Popular posts from this blog

Multilingual Chatbots with Oracle Digital Assistant

Accessing HTTP Response Header Using JavaScript