Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
hofmann
Active Contributor

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

sap-wd-cltwndid

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

sap-wd-appwndid

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

sap-wd-secure-id

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:'(.+?)'}

sap-ext-sid

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.

Example

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:

4 Comments
Labels in this area