VuGen correlation for SAP Web Dynpro

If you are trying to create a LoadRunner script for a SAP Web Dynpro application, and you are having problems correlating the SAPEVENTQUEUE in your POST request, then this Tech Tip is for you…

Here is what a typical request might look like:

1
2
3
4
5
6
7
8
9
10
11
12
13
web_submit_data("sap-ext-sid_2", 
  "Action=http://www.example.com:8000/sap/bc/webdynpro/SAP/ERC_A_WORKCENTER/;sap-ext-sid={SapExtSid2_120}", 
  "Method=POST", 
  "TargetFrame=", 
  "RecContentType=text/html", 
  "Referer=http://www.example.com:8000/sap/bc/webdynpro/SAP/ERC_A_WORKCENTER/;sap-ext-sid={SapExtSid2_98}", 
  "Snapshot=t18.inf", 
  "Mode=HTML", 
  ITEMDATA, 
  "Name=SAPEVENTQUEUE", "Value=Custom_ClientInfos~E002Id~E004WD01~E005WindowOpenerExists~E004false~E005ClientURL~E004http~003A~002F~002Fwww.example.com~003A8000~002Fsap~002Fbc~002Fwebdynpro~002FSAP~002FERC_A_WORKCENTER~002F~003Bsap-ext-sid~003DzuUt57Mx_3JozG7pOff~002AEg--U_0j6OHCaCQurUN1Pimp1Q--~E003~E002ClientAction~E004enqueue~E005ResponseData~E004delta~E003~E002~E003~E001TimeTrigger_Trigger~E002Id~E004WDE4~E003~E002ResponseData~E004delta~E005ClientAction~E004submit~E003~E002~E003", ENDITEM, 
  "Name=sap-charset", "Value=utf-8", ENDITEM, 
  "Name=_client_url_", "Value=", ENDITEM, 
  LAST);

Obviously the sap-ext-sid has already been correlated (this is easy to do with a Correlation Rule), but the SAPEVENTQUEUE also needs to be correlated. This is difficult, as it is constructed dynamically using JavaScript, so the value does not appear directly in any HTML response, and therefore cannot be correlated using a simple web_reg_save_param.

Examining the SAPEVENTQUEUE string, there are two repeated patterns; a series of 5 characters like “~E005”, and a series of 5 characters like “~003A” (without the “E”). Taking an educated guess, we can see that the string…

1
 http~003A~002F~002Fwww.example.com~003A8000~002Fsap~002Fbc~002Fwebdynpro~002FSAP~002FERC_A_WORKCENTER~002F~003Bsap-ext-sid~003DzuUt57Mx_3J

…is an encoding of…

1
http://www.example.com:8000/sap/bc/webdynpro/SAP/ERC_A_WORKCENTER/;sap-ext-sid=zuUt57Mx_3J

…which means that…

  • ~003A is :
  • ~002F is /
  • ~002F is /
  • ~003D is =
  • ~003B is ;

So it looks like SAP has invented their own way of URL Encoding values to be POSTed to a Web Dynpro server.

But what about the encoded values with an “E” at the start? Searching through the source code, we find that these are special “event separators”…

  • ~E001 is EVENT
  • ~E002 is SECTION_BEGIN
  • ~E003 is SECTION_END
  • ~E004 is KEYVALUE
  • ~E005 is KEYVALUE_PAIR
  • ~E006 is COLLECTION_ENTRY

As I am unlikely to want to change the separators, here is a simple function that will encode a string using SAP’s special version of URL encoding.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// This function replaces unreserved characters in a string with their encoded values.
// Encoding is in the style of SAP Web Dynpro. E.g. "abd*def" becomes "abc~002Adef".
// Reserved/unreserved characters are according to RFC3986 (http://tools.ietf.org/html/rfc3986)
// This function returns a pointer to the start of the encoded string (buf).
// Note that buf must be big enough to hold original string plus all converted entities.
char* dynpro_encode(char* plain_string, char* buf) {
  int len = strlen(plain_string);
  int i,j;
  char hex_value[3];
 
  if (plain_string == NULL) {
    lr_error_message("Input string is empty.");
    return NULL;
  }
 
  for (i=0, j=0; i<len; i++) {
    // Check if character is in list of allowed characters.
    // A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
    // a b c d e f g h i j k l m n o p q r s t u v w x y z
    // 0 1 2 3 4 5 6 7 8 9 - _ . ~
    if ( (plain_string[i] >= 'A' && plain_string[i] <= 'Z') ||
         (plain_string[i] >= 'a' && plain_string[i] <= 'z') ||
         (plain_string[i] >= '0' && plain_string[i] <= '9') ||
         (plain_string[i] == '-') ||
         (plain_string[i] == '_') ||
         (plain_string[i] == '.') ||
         (plain_string[i] == '~') ) {
 
      buf[j++] = plain_string[i];
    } else if ( (plain_string[i] < 32 ) || (plain_string[i] > 126) ) {
      lr_error_message("Input string contains non-printable or non-ASCII character %c at position: %d", plain_string[i], i);
      return NULL;
    } else {
      // The unicode value for use in url encoding is the same as the hex value for the ASCII character
      itoa(plain_string[i], hex_value, 16);
      buf[j++] = '~';
      buf[j++] = '0';
      buf[j++] = '0';
      buf[j++] = toupper(hex_value[0]);
      buf[j++] = toupper(hex_value[1]);
    }
  }
 
  buf[j] = NULL; // terminate the string
  return buf;
}

And, just for completeness, here is a function that will decode a string.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
char *strncpy ( char *dest, const char *source, size_t n ); // explicit declaration required
 
// This function replaces encoded characters from with their non-encoded value.
// Decoding is in the style of SAP Web Dynpro. E.g. "abc~002Adef" becomes "abd*def".
// Reserved characters are according to RFC3986 (http://tools.ietf.org/html/rfc3986)
// This function returns a pointer to the start of the decoded string (buf).
// Note that buf must be big enough to hold the decoded string (always equal to or shorter than the encoded string).
char* dynpro_decode(char* enc_string, char* buf) {
  int len = strlen(enc_string);
  int i, j;
  char code[3]; // holds url encoded value e.g. "2F" (/)
  int hex; // decimal value of hex code e.g. 47 (0x2F)
  int rc; // return code
 
  if (enc_string == NULL) {
    lr_error_message("Input string is empty.");
    return NULL;
  }
 
  for (i=0, j=0; i<len; i++, j++) {
    // Only convert entities that do not start with "~E". Do not run off the end of the string.
    if ( (enc_string[i] == '~') && 
         (enc_string[i+1] != 'E') && 
         ((i+4) < len) &&
         (enc_string[i+1] == '0') && 
         (enc_string[i+2] == '0') && 
         (isalpha(enc_string[i+3]) || isdigit(enc_string[i+3])) && 
         (isalpha(enc_string[i+4]) || isdigit(enc_string[i+4])) ) { 
      // Get the hex value from the input string
      code[0] = enc_string[i+3];
      code[1] = enc_string[i+4];
      code[3] = NULL;
      // Convert the hex value to the appropriate character, and add it to buf
      rc = sscanf(code, "%2x", &hex);
      if (rc != 1) {
        lr_error_message("Invalid hex value: %s", code);
      }
      buf[j] = hex;
      i+=4; // skip the rest of this encoded value in the input string
    } else {
      buf[j] = enc_string[i];
    }
  }
 
  return buf;
}

Please share any more tips you have for VuGen scripting of Web Dynpro in the comments section.

31 comments

Hi,

Here I tried to Correlate the SAPEVENTQUEUE but I do not find any kind of object id in response of any calls it’s only coming in request.SAPEVENTQUEUE=”
“RadioButton_Change%EE%80%82Id%EE%80%84aaaa.InvoiceProcessingView.RadioButtonGroupByKey%3A2%EE%80%85Checked%EE%80%84true%EE%80%83%EE%80%82ClientAction%EE%80%84submit%EE%80%83%EE%80%82urEventName%EE%80%84RADIOBUTTONCHANGE%EE%80%83%EE%80%81Form_Request%EE%80%82Id%EE%80%84…form%EE%80%85Async%EE%80%84false%EE%80%85FocusInfo%EE%80%84%40%7B%22sFocussedId%22%3A%20%22aaaa.InvoiceProcessingView.RadioButtonGroupByKey%3A2-lbl%22%7D%EE%80%85Hash%EE%80%84%EE%80%85DomChanged%EE%80%84false%EE%80%85IsDirty%EE%80”
“%84false%EE%80%83%EE%80%82EnqueueCardinality%EE%80%84single%EE%80%83%EE%80%82%EE%80%83”,

Daniel Spavin

Hi Jagan,

The SAPEVENTQUEUE is constructed dynamically using JavaScript – that’s what makes it difficult to correlate.

What sort of object ID were you looking for? From the string you provided I can see the following individual bits that would need to be correlated:
Id = aaaa.InvoiceProcessingView.RadioButtonGroupByKey
Checked = “true”
ClientAction = “form”
Async = “false”
FocussedId = “aaaa.InvoiceProcessingView.RadioButtonGroupByKey”
Etc

Any luck with correlating the EventQueueID?

Appreciate your response

Hi,

What does “sap-ext-sid” denotes ?

I am working on SAP Portal web Application with Load Runner. After recorded the application ,I am getting following dynamic values

SAP-EXT-SID
SAP CONTEXT ID
sap-wd-secure-id
TIME STAMP
SAP IVIEW HANDLE
pcdunit
viewid

I have correlated all the above dynamic values expect SAPEVENTQUEUE. The value is going in the request section of the “web_custom_request”.
When I did a replay of this script, I get the HTTP Status code of 500 Internal Server Error(Please check below message).

Error -26612: HTTP Status-Code=500 (Internal Server Error) for “https:/servername/sap/bc/webdynpro/sap/ZFI_TOV_MANUAL_APP;sap-ext-sid=BJ*3y3Oqu282E_M8Fv6Deg–8FaULehDOAS9jscJwjTMBQ–?sap-contextid=;SID%3aANON%3auk1gcnsd06301_RBD_60%3a-UqR6ZvDBI8EtXmqRVqja8jxbp-KAStpxlh12YLa-NEW” [MsgId: MERR-26612]

I guess the script is failing because I have not done the correlation of SAPEVENTQUEUE. Please let me know how to do the correlation for this particular SAPEVENTQUEUE.
Here I tried to Correlate the SAPEVENTQUEUE but I do not find any kind of object id in response of any calls it’s only coming in request. Is there any way to catch the value of request using web_reg functions or any other way to correlate below id?

SAPEVENTQUEUE=ComboBox_Select~E002Id~E004WD1A~E005Key~E0041~E005ByEnter~E004false~E003~E002ResponseData~E004delta~E005ClientAction~E004submit~E003~E002~E003~E001Form_Request~E002Id~E004sap.client.SsrClient.form~E005Async~E004false~E005FocusInfo~E004~0040~007B~0022sFocussedId~0022~003A~0020~0022WD1A~0022~007D~E005Hash~E004~E005DomChanged~E004false~E005IsDirty~E004false~E003~E002ResponseData~E004delta~E003~E002~E003″

We are using LR 11.52

Any help would be greatly appreciated.

Hi Stuart,

I am unable to find the LB & RB for the Dynamic value ScrollTop~E0040. In this ~E0040 is the Dynamic Value. Please tell me the solution for this.

“Body=sap-charset=utf-8&sap-wd-secure-id={Corr_SapSecureId3}&_stateful_=X&SAPEVENTQUEUE=Page_Scroll~E002Id~E004sapwd_main_window_root_~E005ScrollTop~E0040~E005ScrollLeft~E0040~E003~E002ResponseData~E004delta~E005EnqueueCardinality~E004single~E003~E002~E003~E001ComboBox_Select~E002Id~E004

Hi Stuart,

I m recording the script using SAP web protocol in LR11.51.I have correlated all the dynamic values expect SAPEVENTQUEUE.The value is going in the request section of the “web_custom_request”.The script is fialing after the following code throwing the error message “Action.c(230): Error -26631: HTTP Status-Code=400 (Bad Request) for “http://entsapep.india.TEST.com:50000/webdynpro/resources/sap.com/pb/PageBuilder” [MsgId: MERR-26631]”
I guess the script is failing because I havenot done the correlation of SAPEVENTQUEUE.Please let me know how to do the correlation for this particular SAPEVENTQUEUE.

web_custom_request(“PageBuilder”,
“URL=http://entsapep.india.TEST.com:50000/webdynpro/resources/sap.com/pb/PageBuilder”,
“Method=POST”,
“Resource=0″,
“RecContentType=text/xml”,
“Referer=http://entsapep.india.TEST.com:50000/webdynpro/resources/sap.com/pb/PageBuilder;jsessionid={jsessionid}”,
“Snapshot=t22.inf”,
“Mode=HTML”,
“Body=sap-ext-sid={sap-ext-sid}&sap-wd-cltwndid={sap-wd-cltwndid}&sap-wd-norefresh=X&sap-wd-secure-id={sap-wd-secure-id}&SAPEVENTQUEUE=”
“Accordion_Select%EE%80%82Id%EE%80%84zzzzAIDG.AdminStudioLayoutView._14%EE%80%85ItemId%EE%80%84zzzzAIDG.AdminStudioLayoutView.AccordionItem_0%EE%80%85ToggleIconClicked%EE%80%84false%EE%80%83%EE%80%82ClientAction%EE%80%84submit%EE%80%83%EE%80%82urEventName%EE%80%84Select%EE%80%83%EE%80%81Form_Request%EE%80%82Id%EE%80%84…form%EE%80%85Async%EE%80%84false%EE%80%85FocusInfo%EE%80%84%40%7B%22sFocussedId%22%3A%20%22zzzzAIDG.AdminStudioLayoutView.AccordionItem_0-title%22%7D%EE%80%85Hash%EE%80%84%EE%80%85″
“DomChanged%EE%80%84false%EE%80%85IsDirty%EE%80%84false%EE%80%83%EE%80%82EnqueueCardinality%EE%80%84single%EE%80%83%EE%80%82%EE%80%83″,
LAST);

Thanks

I m recording the script using SAP web protocol in LR11.51.I have correlated all the dynamic values expect SAPEVENTQUEUE.The value is going in the request section of the “web_custom_request”.The script is fialing after the following code throwing the error message “Action.c(230): Error -26631: HTTP Status-Code=400 (Bad Request) for “http://entsapep.india.TEST.com:50000/webdynpro/resources/sap.com/pb/PageBuilder” [MsgId: MERR-26631]”

I guess the script is failing because I havenot done the correlation of SAPEVENTQUEUE.Please let me know how to do the correlation for this particular SAPEVENTQUEUE.

web_custom_request(“PageBuilder”,
“URL=http://entsapep.india.TEST.com:50000/webdynpro/resources/sap.com/pb/PageBuilder”,
“Method=POST”,
“Resource=0”,
“RecContentType=text/xml”,
“Referer=http://entsapep.india.TEST.com:50000/webdynpro/resources/sap.com/pb/PageBuilder;jsessionid={jsessionid}”,
“Snapshot=t22.inf”,
“Mode=HTML”,
“Body=sap-ext-sid={sap-ext-sid}&sap-wd-cltwndid={sap-wd-cltwndid}&sap-wd-norefresh=X&sap-wd-secure-id={sap-wd-secure-id}&SAPEVENTQUEUE=”
“Accordion_Select%EE%80%82Id%EE%80%84zzzzAIDG.AdminStudioLayoutView._14%EE%80%85ItemId%EE%80%84{DIVID1}.AdminStudioLayoutView.AccordionItem_0%EE%80%85ToggleIconClicked%EE%80%84false%EE%80%83%EE%80%82ClientAction%EE%80%84submit%EE%80%83%EE%80%82urEventName%EE%80%84Select%EE%80%83%EE%80%81Form_Request%EE%80%82Id%EE%80%84…form%EE%80%85Async%EE%80%84false%EE%80%85FocusInfo%EE%80%84%40%7B%22sFocussedId%22%3A%20%22{DIVID1}.AdminStudioLayoutView.AccordionItem_0-title%22%7D%EE%80%85Hash%EE%80%84%EE%80%85”
“DomChanged%EE%80%84false%EE%80%85IsDirty%EE%80%84false%EE%80%83%EE%80%82EnqueueCardinality%EE%80%84single%EE%80%83%EE%80%82%EE%80%83”,
LAST);

Hi Stuart,

In my case the object id like “WD05F1” is changing can I catch that one.

Thanks

Stuart Moncrieff
Stuart Moncrieff

In your case you will need to correlate the dynamic value using web_reg_save_param_ex() or web_reg_save_param_regex().

It may take you a few attempts to get the regex (or the left/right boundaries) correct to capture the object ID.

Cheers,
Stuart

Appreciate your quick response Stuart.
I agree with you, but I do not find any kind of object id in response of any calls it’s only coming in request. Is there any way to catch the value of request using web_reg functions or any other way to correlate this id?

Thanks.

Hi guys,

I have problem on SAP Portal Leave Request.

web_custom_request(“HRESS_A_PTARQ_LEAVREQ_APPL;sap-ext-sid={SAP_LeavReqID}_3”,
“URL=https://hrstsg88.sg.uobnet.com:8001/sap/bc/webdynpro/sap/HRESS_A_PTARQ_LEAVREQ_APPL;sap-ext-sid={SAP_LeavReqID}?sap-contextid={SAP_ContextID_LeavReq}-NEW”,
“Method=POST”,
“Resource=0”,
“RecContentType=text/xml”,
“Referer=https://hrstsg88.sg.uobnet.com:8001/sap/bc/webdynpro/sap/HRESS_A_PTARQ_LEAVREQ_APPL;sap-ext-sid={SAP_LeavReqID}”,
“Snapshot=t23.inf”,
“Mode=HTML”,
“Body=sap-charset=utf-8&sap-wd-secure-id={SAP_SecureID_LeavReq}&SAPEVENTQUEUE=InputField_Change~E002Id~E004WD0162~E005Value~E004{Leav_StartDate}~E003~E002ResponseData~E004delta~E005EnqueueCardinality~E004single~E005Delay~E004full~E003~E002~E003~E001InputField_Change~E002Id~E004WD0167~E005Value~E004{Leav_EndDate}~E003~E002ResponseData~E004delta~E005EnqueueCardinality~E004single~E005Delay~E004full~E003~E002~E003~E001ScrollContainer_Scroll~E002Id~E004WD1F~E005ScrollTop~E004312~E005ScrollLeft~E0040~”
“E003~E002ResponseData~E004delta~E005EnqueueCardinality~E004single~E003~E002~E003~E001TextEdit_Change~E002Id~E004WD017C~E005Value~E004Loadtest~0020purpose~E003~E002ResponseData~E004delta~E005EnqueueCardinality~E004single~E005Delay~E004full~E003~E002~E003~E001Button_Press~E002Id~E004WD16~E003~E002ResponseData~E004delta~E005ClientAction~E004submit~E003~E002~E003~E001Form_Request~E002Id~E004sap.client.SsrClient.form~E005Async~E004false~E005FocusInfo~E004~0040~007B~0022sFocussedId~0022~003A~0020~”
“0022WD16~0022~007D~E005Hash~E004~E005DomChanged~E004true~E005IsDirty~E004true~E003~E002ResponseData~E004delta~E003~E002~E003”,
LAST);

For first iteration, it works with Start Date 14th June 2013 and End Date 14th June 2013. And then for second iteration, it failed with Start Date 18th June 2013 and End Date 18th June 2013.

How do i correlate this SAPEVENTQUE=InputField change?

Thanks

I am also facing the same issue. I have correlated WD017C (kind of id) in the script, but still facing 500 Internal server error message in middle of the script. It is bit on priority, so anybody came across this kind of correlation please help.
Also first reply itself it is not working even after changed the dates.

Hi shawal ,

Can you get the solution for this ? , please let us know we are also facing same issue.

hi stuart,
can u please help me how to handle this eventqueue,
“Name=eventQueue”, “Value=BUTTONCLICKî\x80‚Idî\x80‚HODKGFCPEMKJKJIOEBAM.Generic.AEî\x80‚CurrentFocusIdî\x80‚@{\”sFocussedId\”: \”HODKGFCPEMKJKJIOEBAM.Generic.AE\”}”, ENDITEM,
EXTRARES,
if possible please give u number i will call u

Hi Stuart,

I’m trying to record using LR 11.50 (SAP Web protocol) a SAP Web Portal that has WebDyn Pro codes and I cannot seem to capture anything after clicking a link with javascript pop ups.

These are the steps basically:
1. Navigate to site
2. Login
3. Click link (a pop up comes up)
4. …and so on
5. Log off

However, everything stops getting captured on step 3. I have tried changing the network port (capture level) but these would happen: Socket = unable to capture the pop ups; WinInet = pop up freezes and displays a few gifs; Both = same as WinInet.

Any help would be appreciated. Thanks.

P.S.: If this is off topic, kindly move this elsewhere. Apologies and thanks!

Stuart Moncrieff

Here is how you would decode a string, so that you can clearly see the parameters:

1
2
3
4
5
6
7
8
9
10
11
12
Action()
{
	char buf[1024];
 
	// Replace the event queue here, and run the script every time you want to decode a SAPEVENTQUEUE.
	char* encoded_SAPEVENTQUEUE = "Custom_ClientInfos~E002Id~E004WD01~E005WindowOpenerExists~E004false~E005ClientURL~E004http~003A~002F~002Fwww.example.com~003A8001~002Fsap~002Fbc~002Fwebdynpro~002Fsap~002Fzprg_retailsales_iviews~002F~003Bsap-ext-sid~003DDYiorEo_84mRlbjuz_Eg9w--1aJlhGQp43C~002A9AlruJqxWw--~E003~E002ClientAction~E004enqueue~E005ResponseData~E004delta~E003~E002~E003~E001LoadingPlaceHolder_Load~E002Id~E004_loadingPlaceholder_~E003~E002ResponseData~E004delta~E005ClientAction~E004submit~E003~E002~E003";
	//      Decoded SAPEVENTQUEUE: Custom_ClientInfos~E002Id~E004WD01~E005WindowOpenerExists~E004false~E005ClientURL~E004http://www.example.com:8001/sap/bc/webdynpro/sap/zprg_retailsales_iviews/;sap-ext-sid=DYiorEo_84mRlbjuz_Eg9w--1aJlhGQp43C*9AlruJqxWw--~E003~E002ClientAction~E004enqueue~E005ResponseData~E004delta~E003~E002~E003~E001LoadingPlaceHolder_Load~E002Id~E004_loadingPlaceholder_~E003~E002ResponseData~E004delta~E005ClientAction~E004submit~E003~E002~E003
 
	lr_output_message("Decoded SAPEVENTQUEUE: %s", dynpro_decode(encoded_SAPEVENTQUEUE, buf));
 
	return 0;
}

Note carefully the value of the sap-ext-sid parameter:
Encoded = DYiorEo_84mRlbjuz_Eg9w–1aJlhGQp43C~002A9AlruJqxWw–
Decoded = DYiorEo_84mRlbjuz_Eg9w–1aJlhGQp43C*9AlruJqxWw–

The “*” symbol can cause intermittent playback problems for you. If there is no “*” in your SAPEVENTQUEUE while recording (and you are using Correlation Rules), you will probably not think to encode this parameter. On replay you will get an error if the sap-ext-sid parameter now has a “*” character in it.

The rule of thumb is that any parameterised/correlated values that appear in a SAPEVENTQUEUE should be passed through the dynpro_encode() function before being used.

Hi Stuart,

Any one succeeded with “eventQueue” as said above, this has become a pain. I contacted HP, they said we can not correlate because it got Binary data.

Let me know if your thoughts.
DJ

Hi Stuart,

Thanks for this interesting article. I too facing similar problem, but it is little different to what was said above.

Here is the problem;

1. I recorded actions from a SAP Web Portal.
2. My load script fails in the first run itself (before correlation)
2. I am unsuccessful with automatic correlation method.
3. Did correlation manually using WDIF
4. My load script is not having SAPEVENTQUEUE, but exist with SAP-EXT-SID
5. The Param I replaced for SAP-EXT-SID is works fine with the entire script, but only at the last few actions it throws error – 500….. The help docs educates me that its a wrong parametrization.

Can you please help?

Many Thanks
DJ

Any Clue, How to handle, how to handle EventQueue?

		"Name=sap-wd-appwndid", "Value={AppId_P}", ENDITEM, 
		"Name=sap-wd-cltwndid", "Value={ClientId_P}", ENDITEM, 
		"Name=sap-wd-norefresh", "Value=X", ENDITEM, 
		"Name=sap-wd-secure-id", "Value={SecureId_P}", ENDITEM, 
		"Name=asyncRequest", "Value=", ENDITEM, 
		"Name=eventQueue", "Value=BUTTONCLICKîx80‚Idîx80‚HODKGFCPEMKJKJIOEBAM.Generic.AEîx80‚CurrentFocusIdîx80‚@{"sFocussedId": "HODKGFCPEMKJKJIOEBAM.Generic.AE"}", ENDITEM, 
		EXTRARES,
Stuart Moncrieff
Stuart Moncrieff

As you noted, this EventQueue is different to the example above. It is interesting that it includes what looks like double-byte characters – LoadRunner has attempted to represent the character by hex-encoding one of the bytes e.g. “î\x80”

Personally, I would try just correlating the button ID (HODKGFCPEMKJKJIOEBAM), and see if that works.

Remember to add a web_reg_find() before every web_url() or web_submit_data() to make sure that your application is not throwing errors.

Stuart Moncrieff

Here is an example of the dynpro_encode() function in action…

	char SapEventQueueBuffer[7068]; // global variable to hold the value returned from dynpro_encode(). Best to declare this as a global variable (in globals.h), so it can be used by all Actions.
 
	lr_start_transaction("Click start appointment");
 
	// This is a cut-and paste from the SAPEVENTQUEUE parameter in the web_submit_data() function below.
	lr_save_string(
		"Custom_ClientInfos"
		"~E002"
		"Id"
		"~E004"
		"WD01" // Object ID. Best to manually update these when they change, rather than trying to correlate them. Note that if they change, your script might not fail at this point, but will instead fail right at the end of the business process when you press Save.
		"~E005"
		"WindowOpenerExists"
		"~E004"
		"false"
		"~E005"
		"ClientURL"
		"~E004"														 //       {PC_sap-ext-sid_8} = "fjwSvjOEztlCo*7hA33GKg--LtcpLqMP_sohOBcY*M61sA--"
		"https://www.example.com/sap/bc/webdynpro/sap/z_fpm_ss_appoint/;sap-ext-sid={PC_sap-ext-sid_8}" // This is the line that really requires the special encoding. The {PC_sap-ext-sid_8} parameter can contain characters that require encoding. If these are not encoded, the VuGen script will fail at this point. BUT we encode the entire SAPEVENTQUEUE because there are frequently other parameterised fields that will require special encoding.
		"~E003"
		"~E002"
		"ClientAction"
		"~E004"
		"enqueue"
		"~E005"
		"ResponseData"
		"~E004"
		"delta"
		"~E003"
		"~E002"
		"~E003"
		"~E001"
		"Button_Press"
		"~E002"
		"Id"
		"~E004"
		"WD25" // Object ID
		"~E003"
		"~E002"
		"ResponseData"
		"~E004"
		"delta"
		"~E005"
		"ClientAction"
		"~E004"
		"submit"
		"~E003"
		"~E002"
		"~E003",
		"Param_SAPEVENTQUEUE");
	// Uncomment these to understand what is happening.
	//lr_output_message("$$ Decoded value with params: %s", lr_eval_string("{Param_SAPEVENTQUEUE}"));
	//lr_output_message("$$ Encoded value: %s", dynpro_encode(lr_eval_string(lr_eval_string("{Param_SAPEVENTQUEUE}")), SapEventQueueBuffer));
	//lr_eval_string("{Param_SAPEVENTQUEUE}");
	lr_save_string(dynpro_encode(lr_eval_string(lr_eval_string("{Param_SAPEVENTQUEUE}")), SapEventQueueBuffer), "SAPEVENTQUEUE_10");
 
	web_reg_find("Text=View Appointment", LAST);
	web_reg_find("Text=The following is confirmation of your appointment.", LAST);
	web_reg_find("Text=Appointment number", LAST);
	web_submit_data("StartAppointment", 
		"Action=https://www.example.com/sap/bc/webdynpro/sap/z_fpm_ss_appoint/;sap-ext-sid={PC_sap-ext-sid_24}", 
		"Method=POST", 
		"TargetFrame=", 
		"RecContentType=text/html", 
		"Referer=https://www.example.com/sap/bc/webdynpro/sap/z_fpm_ss_appoint/;sap-ext-sid={PC_sap-ext-sid_8}", 
		"Snapshot=t10.inf", 
		"Mode=HTML", 
		ITEMDATA, 
		//"Name=SAPEVENTQUEUE", "Value=Custom_ClientInfos~E002Id~E004WD01~E005WindowOpenerExists~E004false~E005ClientURL~E004https~003A~002F~002Fwww.example.com~002Fsap~002Fbc~002Fwebdynpro~002Fsap~002Fz_fpm_ss_appoint~002F~003Bsap-ext-sid~003DfjwSvjOEztlCo~002A7hA33GKg--LtcpLqMP_sohOBcY~002AM61sA--~E003~E002ClientAction~E004enqueue~E005ResponseData~E004delta~E003~E002~E003~E001Button_Press~E002Id~E004WD25~E003~E002ResponseData~E004delta~E005ClientAction~E004submit~E003~E002~E003", ENDITEM, 
		"Name=SAPEVENTQUEUE", "Value={SAPEVENTQUEUE_10}", ENDITEM, 
		"Name=sap-charset", "Value=utf-8", ENDITEM, 
		"Name=_client_url_", "Value=", ENDITEM, 
		EXTRARES, 
		"Url=/irj/portalapps/com.sap.portal.design.urdesigndata/themes/portal/ZPOWERCOR/common/Hr/hr.gif?7.11.3.2.1", ENDITEM, 
		"Url=/irj/portalapps/com.sap.portal.design.urdesigndata/themes/portal/ZPOWERCOR/common/roadmap/StartPoint.gif?7.11.3.2.1", ENDITEM, 
		"Url=/irj/portalapps/com.sap.portal.design.urdesigndata/themes/portal/ZPOWERCOR/common/button/BtnPrevStepDsblLS.gif?7.11.3.2.1", ENDITEM, 
		"Url=/irj/portalapps/com.sap.portal.design.urdesigndata/themes/portal/ZPOWERCOR/common/button/BtnNextStepDsblLS.gif?7.11.3.2.1", ENDITEM, 
		"Url=/sap/public/bc/ur/nw7/js/classes/PopupManager.js?D0A102E5A5B0", ENDITEM, 
		"Url=/irj/portalapps/com.sap.portal.design.urdesigndata/themes/portal/ZPOWERCOR/common/layout/matrix/gutterImageNarrow.gif?7.11.3.2.1", ENDITEM, 
		"Url=/irj/portalapps/com.sap.portal.design.urdesigndata/themes/portal/ZPOWERCOR/common/checkbox/cb_chk_ro.gif?7.11.3.2.1", ENDITEM, 
		"Url=/sap/public/bc/ur/nw7/js/classes/BlockLayer.js?D0A102E5A5B0", ENDITEM, 
		"Url=/sap/public/bc/ur/nw7/js/classes/RoadMap.js?D0A102E5A5B0", ENDITEM, 
		"Url=/sap/public/bc/ur/nw7/js/classes/ItemNavigation.js?D0A102E5A5B0", ENDITEM, 
		"Url=/sap/public/bc/ur/nw7/js/classes/RoadMapItem.js?D0A102E5A5B0", ENDITEM, 
		"Url=/irj/portalapps/com.sap.portal.design.urdesigndata/themes/portal/ZPOWERCOR/common/roadmap/EndPoint.gif?7.11.3.2.1", ENDITEM, 
		"Url=/irj/portalapps/com.sap.portal.design.urdesigndata/themes/portal/ZPOWERCOR/common/roadmap/Border.gif?7.11.3.2.1", ENDITEM, 
		"Url=/sap/public/bc/ur/nw7/js/classes/Group.js?D0A102E5A5B0", ENDITEM, 
		"Url=/sap/public/bc/ur/nw7/js/classes/Hotkeys.js?D0A102E5A5B0", ENDITEM, 
		LAST);
 
	lr_end_transaction("Click start appointment",LR_AUTO);

Hi Folks,
i am recording SAP web Application.in my scripts,only one correlated value came i.e sap-contextid={sap-contextid4},
my question:- when i run the script,the script is working for 1 user and it is not working for multiple user.. Any ideas would be much appreciated.

i saw in my script,
“Name=SAPEVENTQUEUE”, “Value=Form_Submit~E002Id~E004SL__FORM~E003~E002ClientAction~E004submit~E005ActionUrl~E004~E005ResponseData~E004full~E005PrepareScript~E004~E003~E002~E003”, ENDITEM,

Does i need to corrleate this value to work for running multiple users..if so,please how to decode the value..

Chandrakant Singh

Hi,
I am working on WEB DYNPRO server with LOADRUNNER. I am getting following dynamic values
SAP-EXT-SID
SAP CONTEXT ID
TIME STAMP
SAP IVIEW HANDLE
SM AGENT VALUE
i did correlation for all these but when i am looking into the replay log there after sap-ext-sid value get
substituted i am getting message that different client window id is being used stop running script and contact administrator.
Then i removed the SAP EXT SID correlation and script is working fine with different users also.

Kindly suggest me which all dynamic values should i correlate
and i am unable to view the replay snapshots or the web page while running the script after enabling the show browser while replay option, so i am unable to verify that the script is doing its intented job.

Hi, Speaking on the subject of queues, I had a question completely different to SAPDynPro but related to Loadrunner MQ. I have been using a C based VUGen script for sometime to do Point to Point MQ Messaging. I was using the standard MQ Tester 330 addin provided with LR and connecting to a particualr MQ channel and then to a particular queue.

Recently, my organisation decided that this connect has to happen over SSL. But when i try to inject a message on the same queue and same channel but with SSL, the injection does not happen. Not sure the reason why SSL prevents it. Manually there is not difference, hence i find this issue quite weird. Any ideas would be much appreciated.

Thanks,
Anushtup

hi

can u please clearly tell me at exactly which place i have mention the function,i have lot of syntax error can u please tell me

Thanks

Did anybody figure out where does the function “char* dynpro_encode(char* plain_string, char* buf)”
work? where do you put it in the code and how do you pass the decoded URL to be encoded

Thanks

For a non-programmer, I am pretty skilled at recording and testing SAP-BSP applications, but am now working on my first recording of an SAP Abap Web Dynpro application. Immediately after login the replay produces an HTTP 500 error, and fails to execute. The very next statement has the SAPEVENTQUEUE, so I suspect your information here is relevant to my problem.

I have not yet even reached the point to possibly reach the combo box or check box issues!

Can you please elaborate on where the above coding is to be inserted? As mentioned, I am not a programmer, and blindly tried adding at the beginning of the script. I encountered several syntax errors. Anything you can offer to help me is very appreciated! I have a very short timeline!

Thanks,
Pat Gallaher

Good Morning ,

i have question to ask you about “Web Dynpro”

I have problem in LR “Load Runner”

When I do record I don’t see the pages !! I don’t know why ?!

I’m used “Web Dynpro” if you have any solution tell me I need that to important

Thank you

Regards,
Talib AL-Hamood

Stuart Moncrieff
Stuart Moncrieff

Talib, LoadRunner has problems rendering some web pages in the Tree View.

If your application does not successfully display a recording snapshot in the Tree View, then you will just have to get your script working using the Script view (without snapshots).

Cheers,
Stuart.

Stuart Moncrieff
Stuart Moncrieff

Why does SAP always build applications “their own way” i.e. in a non-standard way?

Have you tried automating a Dynpro application using QuickTest Pro? It’s really painful. Here’s an example from the HP Support Site:

Web dynpro | 06/18/06 22:49:09
Problem 1:
When recording a combo box / drop down list, QTP records it as a button and then sets the info into an edit field Will not see it as a combo box and will not run on replay. It will not select and attempts to write into an uneditable field.

1
2
Browser("X").Page("Incident Creation").Frame("4FDC").WebButton("WebButton").Click
Browser("X").Page("Incident Creation").Frame("4FDC").WebEdit("WebEdit").Set "Test Acc Loc

Problem 2:
When recording a CheckBox, QTP records it as a

1
WebElement Browser("X").Page("Incident Creation").Frame("FrameMain").WebElement("Health").Click

What is Web Dynpro application ABAP Web Dynpro communicates to SAP ABAP code directly, and displays it at the presentation layer in a web browser When this opens you get: SAP NetWeaver Web Dynpro ABAP Final Release 7.00 SP 0006 Starting Application…….

Source code does show the objects as ComboBox and CheckBox The HTML ID shows correctly in QTP as found in the source code eg ComboBox WD84 displays in QTP as WebEdit WD84 QTP is using Web objects and not SAP objects. Anyone keen to help with this, I can supply screen shots and source code files.

I have even seen a Dynpro application where the html id (the only unique object property apart from the x/y coordinates) changes every time a new build is deployed (every day).

Leave a Reply