Skip to Content

A couple of days ago my client wanted to load test Web Dynpro ABAP applications. After a few search on Google I found some products. Several downloads and searches I decided to use Apache JMeter. It is easy to use Apache JMeter with web applications. But on our hand we have Web Dynpro ABAP. We will record our scenario and replay it with parameters.

Let’s start to test it.

Click on jmeter.bat in JMeter folder to start.

First create a “Thread Group” by right clicking on Test Plan. Select “Add->Threads(Users)->Thread Group”.

/wp-content/uploads/2012/07/1_117793.png

Then right click on newly created “Thread Group” and select “Add->Config Element->HTTP Request Defaults”

/wp-content/uploads/2012/07/hana_01_117794.jpg

We want to manage cookies so add “HTTP Cookie Manager”. Right click on “Thread Group” select “Add->Config Element->HTTP Cookie Manager”

/wp-content/uploads/2012/07/hana_02_117795.jpg

We want to record our scenario. So add a “Recording Controller”. Right click on “Thread Group” select “Add->Logic Controller->Recording Controller”.

/wp-content/uploads/2012/07/hana_03_117796.jpg

And last step add a “Listener” so we can view requests. Right click on “Thread Group” select “Add->Listener->View Results Tree”

/wp-content/uploads/2012/07/hana_04_117803.jpg

So we have done in “Test Plan”. We want to record our scenario, so we will add an HTTP Proxy.

Right click on “WorkBench” select “Add->Non-Test Elements->HTTP Proxy Server”.

/wp-content/uploads/2012/07/hana_05_117804.jpg

Yes we are ready to record scenario. Open your Internet Explorer and set proxy “127.0.0.1” and port “8080”.

(No need to paste screenshot!)

Enter your Web Dynpro ABAP application url and do something in it. After you clicked something in your application let’s view “Recording Controller”.

Here i deleted js files and css files in the list. You can do it in HTTP Proxy server excluding them.

/wp-content/uploads/2012/07/hana_06_117805.jpg

As you see in screen shot values are changed. These are values which Web Dynpro ABAP uses to handle. If you dont change them you cannot test your application. So I used “Regular Expressions Extractor” to get them and use them. There are two parameters “sap-contextid” and “sap-wd-secure-id”. Find request which they are in response body. And right click on request which you find them in response. Create two “Regular Expressions Extractor”.

/wp-content/uploads/2012/07/hana_07_117812.jpg

/wp-content/uploads/2012/07/hana_08_117813.jpg

/wp-content/uploads/2012/07/hana_09_117814.jpg

These regular expressions get parameter values from body, and you can use them as a variable in the requests:

/wp-content/uploads/2012/07/hana_10_117819.jpg

And now you are ready to test your Web Dynpro ABAP application.

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Frank Stødle

    Hi Erhan, thanks for shedding some light on this interesting topic. I have tried to record a web dynpro application session as you described, but when I run the script afterwards it fails, apparently because the cookie is not used. Instead of the first HTTP request returning the sap-contextid and sap-wd-secure-id, I see from the HTTP response that cookie is disabled. Did you configure SAP or your web dynpro application in a particular manner to allow the SAP cookies to be recorded and reused by JMeter?

    This is the response from the initial request to the web dynpro application:

    
    

    <html>
    <header><title>SAP NetWeaver – Log on is being prepared</title></header>
    <style>
    table{font-size:0.8em;}
    </style>
    <script>

    function icf_system_cookiesDisabled(){
    var cookie_field = document.getElementsByName(“sap-system-login-cookie_disabled”)[0];
    var cookie_old = cookie_field.value;
    document.cookie = “Active=true;EXPIRES=Monday, 31-Dec-2013 23:59:59 GMT;”;
    if (document.cookie.indexOf(“Active=true”) >= 0) {
    document.cookie = “Active=true;EXPIRES=Monday, 31-Dec-2013 23:59:59 GMT;”;
    cookie_field.value = “”;
    }
    else{
    cookie_field.value = “X”;
    }
    return cookie_field.value != cookie_old;
    }
    </script>
    <body onload=”icf_system_cookiesDisabled();document.forms[0].submit();” style=”overflow:hidden; font-family: Arial, sans serif;” >
    <form method=”POST” action=”HTTPS://sapq152.statoil.no:4308/sap/bc/webdynpro/sap/zompm_timp_it_solution_a”>
    <noscript><iframe style=”position:absolute;top:0;left:0;width:100%;height:100%” src=”?sap-system-login-oninputprocessing=onNoScript”></noscript>

    <input type=”hidden” name=”sap-system-login-oninputprocessing” value=”onProceed”>
    <input type=”hidden” name=”sap-urlscheme” value=””>
    <input type=”hidden” name=”sap-system-login” value=”X”>
    <input type=”hidden” name=”sap-system-login-basic_auth” value=””>
    <input type=”hidden” name=”sap-client” value=”215″>
    <input type=”hidden” name=”sap-language” value=”EN”>
    <input type=”hidden” name=”sap-accessibility” value=””>
    <input type=”hidden” name=”sap-user” value=””>
    <input type=”hidden” name=”sap-password” value=””>
    <input type=”hidden” name=”sap-system-login-cookie_disabled” value=””>

    <table width=”100%” height=”100%”><tr><td align=”center” valign=”middle”>Log on is being prepared</td></tr></table>
    </form></body></html>

    (0) 
    1. Erhan Keseli Post author

      Hi Frank!

      I didnt configured anything different. It is a custom application but nothing changed. Did you add Cookie Manager to JMeter?

      (0) 

Leave a Reply