Skip to Content
Author's profile photo Tobias Hofmann

Load test your web application (part 2 of 2)

This blog is laying around on my hard drive for too much time. The previous version of this blog series was published over a year ago!. Originally named “Load test Web Dynpro Java with jMeter” this was actually the 1st blog of the 3 part series. During the last year, a few blogs about jMeter were published, but as I do not want to leave the series unfinished, I am publishing now (finally) the last part of my load test your web application blog.

To make it easier a jMeter test plan is attached to this blog. This plan can be used in conjunction with a WDJ application. Both were used for the creation of this blog.

With jMeter

JMeter is a great tool for testing your web applications. And you can even use it to test Web Dynpro Java applications. To facilitate the work of creating the tests, jMeter comes with a proxy to intercept browser requests and add them to the test. This allows for easy and fast recording of tests.

jMeter test for sample WDJ application:

/wp-content/uploads/2013/08/jmeter1_262619.jpg

As by default a WDJ application is accessible as anonymous – or Guest – user, authentication is not needed and a test can be executed several times against the WDJ application. Pretty easy but in real life you’ll hit real soon a hard limit. By default ,the HTTP Cookie Manager controller does not delete cookies with each iteration, or: JSESSIONID is not deleted.

Simulating users

Running the test and checking the user sessions in NWA shows that the same Guest session is used.

/wp-content/uploads/2013/08/jmeter2_262620.jpg

With that you may be tempted to run the test and to see the load generated by just 1 user. But try to run the test 50 times. After some calls, jMeter shows an error when executing the open WDJ app step.

/wp-content/uploads/2013/08/jmeter3_262621.jpg

The error message returned from the server is:

/wp-content/uploads/2013/08/jmeter4_262625.jpg

HTTP 403? Yes, 403. Re-using the same session will ensure that you`ll hit a well known limitation. You can now opt to implement SAP note 1012065, but it is better to end the session after each iteration. While only one Guest session is open, the maximum number of application sessions is exceeded: 23

/wp-content/uploads/2013/08/jmeter5_262626.jpg

Now let jMeter create a new session with each iteration.

/wp-content/uploads/2013/08/jmeter6_262627.jpg

The new sessions are created because the HTTP Cookie Manager deletes the JSESSIONID cookie with each iteration. Run the test 5 times, the open sessions in NWA will show

/wp-content/uploads/2013/08/jmeter7_262628.jpg

To access the report, go to: Availability & Performance -> Resource Monitoring -> Session Monitoring


If now a test with 500 iterations is run, 500 Guest sessions will be created. This may not a problem, but won’t reflect your reality where sessions are ended after the user navigates away. Logging in and off creates additional load, something worth to test too. Besides this, each session occupies some memory. Depending on your test case, this amount of memory can consume quite some substantial part of the free memory, compromising your test results.

The correct way to test WDJ applications is to end the user session after the test is executed, independently if Guest or named users are used. To end the session, all it takes is to delete the cookies each iteration and trigger a logout action: /irj/portal?logout_submit=1 [you have the portal installed in the same instance, right? If not, you’ll have to add your own logoff functionality to the application]

/wp-content/uploads/2013/08/jmeter8_262629.jpg

Add this step at the end of the test.

/wp-content/uploads/2013/08/jmeter9_262630.jpg

With a HTTP sampler as the last step, each iteration can be started with a new session without overloading the NetWeaver Java server with Guest or user sessions.

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Robin Van Het Hof
      Robin Van Het Hof

      Great blog Tobias, and many thanks for pointing out the max-session-exceeded workaround!

      This is something that I have hit before, and never had the time to delve in to solve, so your blog is much appreciated!

      Author's profile photo Tobias Hofmann
      Tobias Hofmann
      Blog Post Author

      Glad you liked it.