Tuesday, July 23, 2013

Trouble scripting against a secure webservice that uploads files via MTOM

I am currently testing a secure webservice that uploads files to an IBM FileNet server via MTOM. The service uses two way authentication through a certificate which has been installed on the root of the machine I am scripting on.
The service is functioning when tested using SoapUI.

I have imported the WSDL using VUGEN for the service that i am testing.

I then added a call to the operation for uploading a file. I have also added the custom header with the username and password for the service.

When I run the service I am getting errors and the files are not uploaded to FileNet. Please note that I have successfully scripted against some of the other operations for same WebService, i.e. retrieve document details and this works ok so I dont think its an authentication issue that I am encountering.

From the documentation i have found so far I believe that VUGen supports MTOM. Can you advise the correct method of adding a webservice call to add an attachement via MTOM.

I will update my script as an attachement as well as the errors encountered. Not i have tried but Soap_Request and Web_service call.
When LoadRunner (LR) executes a Web Services/MTOM script it uses a Microsoft WCF router within the Load Generator machine for communicating with the Web server. This can be confirmed in the Vugen replay log. For example:


action.c(5): Web service call "Open_document_102" started
action.c(5): Creating handler
action.c(5): Searching for wcf router
action.c(5): Preparing router


The LR Controller picks up the Web Resource metrics such as "Hits per Second" and "Throughput" from the LR HTTP replay engine running on the Load Generator. However, the LR HTTP engine is bypassed in this case and these metrics are not available from an Microsoft WCF router. This explains why there is no data in the "Hits per Second" or "Throughput" graphs in the Analysis session containing a Web Services/MTOM script.

The web_add_header function can be used to specify a custom header in "simple" Web Services scripts where no scenario is specified (in the "Protocol and Security" tab in "Manage Services").

However if a scenario type is specified in the Web Services script, for example, "MTOM" is selected, the web_add_header function cannot be used to specify a custom header. This usage is not currently supported by LoadRunner.

An enhancement request has been submitted to add this capability to LoadRunner for the Web Services protocol.
Please install vugen 11 patch 3 that I have uploaded to the case FTP
ftp://SC0441f1:my=XV5nx@ftp.usa.hp.com/

the file name is: LRVUG_00015.exe

Correlating SAP Event queue ( SAPEVENTQUEUE) value in SAP Web dynpro portal application using loadrunner.

In general HTTP correlations, most of the times we capture the value using Web_reg_save_param. One of our client has having SAP portral with Webdynpro environment. But in this application the value going to server is having different than the one captured value, below is the example

The challenge here is:
the captured Dynamic value od SAP Ext SID is:
sap-ext-sid=bthS*ed*7aBmxbOyv*kQYw--BOJtGMTw_1wFLGmQve28Gg- -
But it is going to the server in SAP in some other format.
ITEMDATA,
"Name=SAPEVENTQUEUE","Value=Custom_ClientInfos~E002Id~E004WD01~E005WindowOpenerExists~E004false~E005ClientURL~ ~003Bsap-ext-sid~003dbthS~002Aed~002A7aBmxbOyv~002AkQYw--BOJtGMTw_1wFLGmQve28Gg--~E003~E002ClientAction~E004enqueue~E005ResponseData~E004delta~E003~E002~E003~ Action~""E004submit~E003~E002~E003", ENDITEM,
If you observe here, the *in the value is replaced by ~002A, So we have wrote a piece of code to convert that to desired format. Pleas use the below code.
//declare these variables outside of Action block.
int i;
char myVal[100];
char buffer[];
char newSId[]="";
char separators[] = "*";
char *token;
char * position;
//Insert this function above the Action request from which you are capturing the SAP Sid value. Don’t //forget to converting HTML to Text format.
web_reg_save_param("sId_SAPEVENT", "LB=sap-ext-sid=", "RB=\" target=\"Search and", "CONVERT=HTML_TO_TEXT", LAST);

//Let’s here you have request
//Http call
//Insert this code after HTTP request from where you are capturing this value

i=100;
sprintf(newSId,lr_eval_string("{sId_SAPEVENT}"));
position = (char *)strstr(lr_eval_string ("{sId_SAPEVENT}"), "*");
if(position != 0){
i = strcspn (newSId,"*");
token = (char *)strtok(newSId, "*"); // Get the first token
sprintf(myVal, "");
while (token != NULL ) { // While valid tokens are returned
if((i+1) == 1){strcpy(myVal,"~002A"); i=100;}
strcat(myVal,token);
token = (char *)strtok(NULL, "*"); // Get the next token
if(token != NULL){strcat(myVal,"~002A");}
}
lr_save_string (lr_eval_string (myVal),"sId_SAPEVENT");
}
//You can pass this {sId_SAPEVENT} value in your calls, this holds the SAP EXT SID value after replacing * with ~002A

Unable to execute the citrix script in controller

We built citrix scripts in vugen(LR 11) and the scripts are working fine in Vugen, In controller the scripts are working individually.

While working with Multiple users with Multiple scipts in controller users are directly going in to failed state.
The Error was:
"Abnormal termination, caused by mdrv process termination"
"Action.c(15): Error: Got unexpected disconnect event, exiting ..."
The details are
LR version : 11.00
ICA : Program Neighborhood( Citix Xen App)

e do not recommend you run Citrix or other GUI VUsers on a controller used as a generator. Do you have a remote generator available you can use? It may work in an emergency or for a small number of vusers.
Please confirm you have Patch 2 applied to all your LR11 components – as it is required; and please let me know the following:
- Citrix XenApp server version.
- XenApp Client version.
- If you are using the later XenApp client, you will need to run our LR agent as a process (by default it runs as a Windows service). Here is a KB: http://support.openview.hp.com/selfsolve/document/KM1139367 -- because the LR agent is implemented slightly differently on a controller, I am not sure the workaround is applicable; you may try to run the agent process by executing magentproc.exe in LR\launch_service\bin. Again please do use remote generators for Citrix VUsers.
- On the controller (and any generator) we require you have the Citrix Registry Patch applied after you install LR and LR patches, and if your Citrix client is updated/re-installed. You can double-click the registry patch file we include with LR, in the product folder LR\dat – it is named Enable_Citrix_API.reg. If this patch is not applied before you record or replay you will have problems.
- are you using the LR Citrix agent on the Citrix server(s) hosting the app – if so, please let me know the agent patch level.
- can you launch multiple instances of the Citrix app from the controller using your ICA file or program neighborhood agent (or Citrix web interface) – outside of VuGen, in the same user console session on the controller?

- Does your Citrix server(s) have the ICA connection settings set to “terminate session” when the session is disconnected? If you don’t have this set, if the sesssion terminates or dies unexpectedly, the second time it is launched/ran, will re-connect to that application in the same state. Setting “terminate session” is needed for load testing and your Citrix admins can help configure it on the Citrix servers.
- If installing the registry patch or running the agent as a process doesn’t’ help, and if you can launch multiple instances of the app from the same client outside of VuGen, please upload to the case:
  1. your script, replayed with full extended logging (all three extended log options) – plus “always send messages”.
  2.  your ICA file used to launch your app
  3. all of the info above.

How to record mobile applications in LoadRunner 11 patch 3

LOADRUNNER MOBILE PROTOCOL:
With the new Mobile App (HTTP/HTML) protocol added to LoadRunner 11 in Patch 3, there are three recording options in the recording Wizard:

1.Record and Analyze Traffic - Use mobile sniffer agent to capture traffic and then analyze.

2.Analyze Traffic - Analyze traffic using existing capture file to generate script.

3.Record Emulator - Record script using a mobile device emulator.

Option 1 allows Vugen to connect to the mobile agent on the server or localhost and carry out the business process for recording.More information is available in the online help in: Mobile Protocols > Mobile App (HTTP/HTML) > How to create a script by Recording and Analyzing Traffic. 

Option 2 allows Vugen to scan a pre-captured network traffic (WinPcap) file and generate the code based on the traffic.More information is available in the online help in Mobile Protocols > Mobile App (HTTP/HTML) > How to create a script by Analzying Traffic and in Mobile Protocols > Mobile App (HTTP/HTML) > How to create a script by Analzying Traffic

Option 3 allows Vugen to record an emulator installed on the Vugen machine. With this option, you need to verify that you are able to bring up the emulator and navigate to a URL outside of Vugen to make sure the emulator settings are correct.

More informaiton is available in the online help under: Mobile Protocols > Mobile App (HTTP/HTML) > Recording with Emulation

NOTE: The Mobile TruClient protocol is recommended for browser-based mobile applications -- Mobile TruClient protocol launches Firefox to record the business process.