A colleague recently asked me if it was possible to test SAP portals using JMeter. The short answer is yes.
Some people get confused with the additional protocols that LoadRunner sports for SAP, particularly the SAP GUI. But if your SAP portal uses plain old HTTP (or HTTPS) then JMeter can do the job.
There are a few gotchas which I will continue to update on this post, namely around correlation. In JMeter, correlation is particularly *easier* because you don’t have to worry about where to position a correlation rule. The equivalent function to use is a Post Processor -> Regular Expression Extractor.
I used the following rules to help correlate the SAP portal:
Response Field to check: Body
Reference Name: sap-ext-sid
Regular Expression: sap-ext-sid=”(.+?)”
Template: $1$
Match No.: 1
Response Field to check: Body
Reference Name: sap-wd-tstamp
Regular Expression: name=”sap-wd-tstamp” value=”(.+?)”
Template: $1$
Match No.: 1
Response Field to check: Body
Reference Name: sap-ep-iviewhandle
Regular Expression: name=”sap-ep-iviewhandle” value=”(.+?)”
Template: $1$
Match No.: 1
Just scope those globally in your thread group and they will find and populate the necessary variables with ${variable_name}
All you need to do to your final script is find and replace all instances of those variables with the JMeter variable in your favourite text editor. On windows I find SciTE is free (normally installed with Ruby) and powerful. e.g.
Replace:
7QQ8jk_TEknhboPm9fmgqw–Mce5By08HC1RDy9m4LImcA–
With:
${sap-ext-sid}
In our particular portal a cookie value is used in the context of a query parameter (or form value). So to read a cookie value from the HTTP Cookie Manager element at run time (make sure you include it in your Thread Group) you just use another regular expression extractor:
Response Field to check: Header
Reference Name: MYSAPS02
Regular Expression: MYSAPSSO2=(.+?);
Template: $1$
Match No.: 1
Note in this case I am checking the header rather than the body for this value. Then use the variable as before.
Another tip when recording SAP portals, you might want to use the BadBoy recorder which can export to JMeter test plans. I had more success using this over the traditional recording proxy in JMeter.
Social tagging: jmeter > SAP
Hi Tim,
Nice article. We used it as inspiration when we did our scripts for SAP Enterprise Portal 7.0 SP17, but it does not seem to work after installing SP20.
Do you have similar experiences?
br,
Andreas
ps. Consider adding “sap-wd-secure-id” and “sap-wd-ctrwndid” to the list above.