Skip to Content
Author's profile photo Tobias Hofmann

Record Web Dynpro Java tests with jMeter

Content this document is based on:

As you can see from the above content, jMeter allows to load test a WDJ application. But how do you create the jMeter tests? A test consists of several browser request to the application, submitting data, headers, cookies, etc. It’s not feasible to add all request manually. Therefore, jMeter comes with a reverse proxy that intercepts the browser requests and uses them to create the tests. Short: jMeter records every interaction between the browser and the server. This also means that when you use Internet Explorer to record the test, jMeter will act as Internet Explorer to the server when running the test. To test with different browsers, it makes sense to record the test with each browser.

To record browser navigation, add a proxy and configure it accordingly.


Important: URL Patterns to Exclude

Depends on what you want to test: the application only or also the impact of loading HTML resources like CSS and Javascript. Patterns to just test the application:

  • .*\.css.*
  • .*\.js.*
  • .*\.gif.*
  • .*\.png.*

For the test group, add the controllers

  • HTTP Cookie Manager and
  • HTTP Request Defaults

The later one needs to be configured to point to the NW AS Java server:


Browser settings

jMeter records what passes its proxy, so when you use Internet Explorer, jMeter will record how IE is interacting with the application. As SAP may choose to send out other files when accessing the application using Firefox or Chrome, you have to run the same recording steps again for each browser that is going to be tested. The browser needs to be configured to use the jMeter HTTP Proxy:


Record the test

After the HTTP Proxy is started, execute in the browser every step at once and name the step in jMeter. This helps a lot in identifying each step after the test is recorded.


Replay the test

This is a step where special attention is needed. Right after recording the steps they can executed using jMeter and everything will work. Replaying the script some time later, the test will fail:


Failed to process the request: Request refers to an unknown session

The reason is that WD uses several parameters to identify a session. When the browser is calling the application, additional information is also send. This information is recorded by jMeter:


Of course, this information is not valid anymore.

Hint: when you record your test and immediately afterwards replay the samples, it may work, as the session can still be open and valid. Running the test 5 days later will show errors, as the sessions expired.

How are these values set?

These values are set by the WDJ application. The first time the browser accesses the application, WD initializes a session and sets these values. The values are set inside the HTML file sent back to the browser. They are not cookies and therefore are not handles by the HTTP Cookie Manager. jMeter comes with regular expression extractors that allow to extract the value of a given regular expression and assign it to a jMeter variable. These variables in turn can be used as placeholders in the HTTP requests.

Some useful parameters to extract are

  • sap-wd-cltwndid
  • sap-wd-appwndid
  • sap-wd-secure-id
  • sap-ext-sid


name=”sap-wd-cltwndid” value=”(.+?)”



name=”sap-wd-appwndid” value=”(.+?)”



This parameter depends on your NW AS Java WD version.

7.1: name=”sap-wd-secure-id” value=”(.+?)”


7.3: {0:’sap-wd-secure-id’,2:'(.+?)’}



name=”sap-ext-sid” value=”(.+?)”


Adding these regular expression extractors to the test case will assign the variables with the current valid parameter value. Now the HTTP request needs to be adjusted to make use of the variables.  In my case, I annotate the values of the parameter and substitute them through variables using notepad.



The value is k6V1s3CcEmwzsSJH6ummAg==. The values needs to be replaced by ${sap-wd-secure-id}


Afterwards, the HTTP Request looks like this in jMeter:


After adjusting these parameters, running the jMeter test now gives:


Assigned Tags

      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 as always Tobias, I just can't believe it has so little views yet...

      I myself can't wait to test this out anytime soon!

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

      Hi Robin,

      glad you liked it, hope you can apply it sometime.

      Little views? Published over 2 month ago, makes hardly 3 views per work day. Yes, from effort / view ratio this content is for sure a complete failure.

      Lesson learned: don't write about tests and avoid the name Java in the title. Maybe publishing it as a document and not as a blog didn't help too. Should I move on and write about: 10 tips on how to pass SAP certification?

      Author's profile photo Robin Van Het Hof
      Robin Van Het Hof

      Maybe just use it as a title to gain attraction, but leave the content to be just portal, Java, Web Dynpro, etc 😉

      Author's profile photo Andrew Barnard
      Andrew Barnard

      From an effort / view ratio, you may consider this a failure - but the content is very valuable. Just what I was looking for. Thanks for the effort!