Wednesday 23 November 2016

Reasons for High response time

It all depends on you scenario setup. How you have setup scenario to run vusers, is it initialize all vusers simultaneously or is it in ramp up fashion.....so having response time high could be your application as well but again you have to look over your scenario settings then come up with conclusion over high response time.

Execution logs are the logs which got captured during your test based on client server communication.


During on of my project .SWT file was taking longer time.


Response from Team:


Very 1st point generally we should not keep login part in Action section of script as it doesn't seem to be a realistic scenario. Think does real world user (Customer) login and logout that frequently as you are making your application to do in your scenario? My suggestion would be to keep login in init and logout in end section of scripts. But still taking your scenario into consideration.

I am not sure if this way I can help you without having look at the results but still you can try as mentioned below:

1. You must be having .lrr file as test results. (If test was executed in controller)

2. Open .lrr file with Analysis LR component. Let it open complete 100% data. Data generation can be seen at bottom on analysis component.

3. Once 100% data is generated. Open Average Response Time graph.

4. Right click on graph select merge graph and select running vuser graph. This will give you running vuser and average response time graphs in single graph.

5. With this graph you can find exactly after what user load login transaction started taking more time. Once you find the point where login transaction starts consuming more time note down the time and note down what is user load at that particular point of time.

6. Now open other graphs like CPU utilization, Memory utilization (Committed Bytes/ Available MB) check there consumption level if there are normal utilization if you see utilization beyond 90% note down user load and point of time when your server starts consuming beyond 90% level.

Report this to development/Application team with this detail. This will help them.

Ask them to monitor application server from back end while you are running load test. This will give them great understand of root cause.

7. If you have tools like NewRelic,Appdynamics or Dynatrace from there you can drill down transaction wise and find out the culprit behind the high respone time. It could be a database query taking high response time,Network delay, high Disk read/write or multiple queries getting fired for the same transaction.





Tuesday 22 November 2016

common recording problems

Problem 1: No events are being recorded
Here are the most common reasons why no events are showing in the script:

The events counter keeps increasing, while the generated script is empty
This may be because VuGen’s recording mechanism fails to identify HTTP data. To fix it, ensure that your application indeed uses HTTP Web traffic. If the application uses SSL connections, make sure you choose the correct SSL version (SSL 2, SSL 3, TLS) through the Port Mapping dialog, available by clicking the ‘Options…’ button on the Record > Recording Options… dialog:

The Advanced Port Mapping Settings dialog opens when you click ‘Options…’:

The events counter shows less than five events, while the application keeps getting data from the server
In this case, VuGen’s recording mechanism fails to capture any network activity at all. Ensure that your application really does provide some network traffic, ie. it sends and receives data through the IP network. If an antivirus program is running, turn it off during recording. Check the recording log for any clues about the recording failure. Messages such as “connection failure” or “connection not trapped” can be a sign of the wrongly configured Port Mapping settings.
In addition, if you are recording on a Chrome or Firefox browser, make sure that all the instances of the browser are closed prior to the recording.

Problem 2: Specific events are not recorded
This problem could be caused by the event being dropped as “uninteresting”. By default, VuGen’s Web (HTTP/HTML) protocol records client requests that return an HTTP response status of 2xx or 302, and discards all other requests. If a missing request returns a response that was discarded, such as 301, you can make a modification to the registry to instruct VuGen to generate a command for it:

  • Locate the following registry key:
    • [HKEY_CURRENT_USER\Software\Mercury Interactive\Networking\Multi Settings\QTWeb\Recording]
  • Add the following string value to it:
    • "GenerateApiFuncForCustomHttpStatus"="301"
Problem 3: The recorded application becomes unresponsive during the recording
This could be caused by VuGen’s recording mechanism not being able to connect to the application’s server. Network connection errors can be seen in the Recording Log:

[Net An. Warning  (1068:197c)] Request Connection: Remote Server @ 123.123.123.123 - 5222 (Service=) Failed attempt #1. Unable to connect to remote server: rc = -1 , le = 10060)
[Net An. Warning  (1068:197c)] Request Connection: Remote Server @ 123.123.123.123 - 5222 (Service=) Failed attempt #2. Unable to connect to remote server: rc = -1 , le = 10060)

Note: the Recording log is in the ‘Output’ pane.  Make sure ‘Recording’ is selected in the combo-box on the left:

In order to fix this problem, the Port mapping for the specific IP and port should be added to the Port Mapping dialog (under theRecord > Recording Options… menu), and the entry should be unchecked. That will ensure that the above IP and port are not recorded – that application simply connects to them without any LoadRunner involvement. For the messages above the correct setting would be:

This workaround can be done in case the communication to 123.123.123.123:5222 is not important for the business process and can be omitted. If that’s not the case, the same entry should still be added, but left as checked. That will ensure correct traffic capture to this address.

Problem 4: During the recording the recorded application shows an error message about the wrong server certificate
The problem is caused by the inability of the client side to verify the validity of the server certificate. In order to fix this problem, the LoadRunner Certificate Authority (CA) file should be added to the machine’s “Trusted Root Certificate Authorities” certificate store (in case of a Java client application, LoadRunner’s CA should be added to Java’s trusted CA list using the keytool). This file is supplied with LoadRunner, and is called wplusCAOnly_Expiration_2022.crt. It’s located in the <LR_folder\bin\certs> folder.

To add it to the store, double-click on the file to open the certificate:

Then click ‘Install Certificate…’ to open the Certificate Import Wizard’:

Make sure you check ‘Place all certificates in the following store’ and select ‘Trusted Root Certification Authorities’.  When the wizard is completed, you should be able to record the application.

Problem 5: The browser crashes during recording when using the Ajax Click and Script protocol
This can happen when some of the Ajax controls inside the application are not recognized by VuGen. In order to fix it:

  • Go to the  <LR_folder\dat\protocols> folder and open the WebAjax.lrp file
  • Comment out the following: DllGetClassObject:jscript.dll=DllGetClassObjectHook:ajax_hooks.dll (simply put a semi-colon (‘;’) in front of the line)
You should now be able to record the application.



We hope you found this article useful.  Let us know by leaving a comment in the box below.

Monday 7 November 2016

Dynamic Value in Response Header and Need to corelate

Go to Recording Options / HTTP properties / Advanced / Headers and add 'x-csrf-token' or select 'Record header not in list'.
Then record or regenerate the script.

Note: the header name (in web_add_header) is without the colon (:) or space. The right boundary in web_reg_save_param should be \r\n not =


web_add_header("x-csrf-token","{XCsrfToken}"");


The header looks like as follows in server response,

 x-csrf-token: 0FTcidqErDFSk1hTsw0rIw==

I have tried to correlate the function as follows on a proper request,

web_reg_save_param("XCsrfToken","LB=x-csrf-token:  ","RB=\r\n","Search=Headers",LAST);


To remove this error, go to recording options->Preferences-> headers and add C-XSRF Token in headers via clicking this option and regenerate your script again.



Sunday 6 November 2016

Converting Fiddler Session To VuGen Script In Loadrunner

In this tutorial, I will show you how to convert Fiddler session to Loadrunner Script.

Download the fiddler from the following website: http://www.telerik.com/fiddler. You can also download chrome extension of fiddler here.


Click on Install, once you download the Fiddler, as shown in the following images.


Fiddler Installation 1

Fiddler Installation 2


Fiddler Installation 3

Fiddler Installation 4

Once you install the Fiddler go to Start -> Programs and Search for Fiddler OR go to Internet explorer and click on tools and click on Fiddler.

Fiddler Launch

Once you launch the fidller, click on WinConfig and Click on exempt all and click on save changes.

WinConfig Settings

Now, open the application in the internet explorer. The events will be automatically recorded in fiddler as shown in the following image.

Recorded Events

Once the navigation has been completed, click on save sessions.

Save All Sessions

The file will be saved with .SAZ extension.

Open the vugen, click on File Open->script/solution and select all files as shown in the image. and select the .saz file. 
All Files


The vugen will automatically converts .SAZ file to Loadrunner script.

Generating Vugen Script


Generating Vugen Script 2

Siebel Web Protocol In Loadrunner

Siebel Customer Relationship Management (CRM) is one of the top CRM applications, which help organizations to achieve maximum sales, marketing, customer service etc.

Siebel protocol is similar to Web (HTTP/HTML) protocol, but has made lot of changes to the settings to work with Siebel Web Protocol. It is one of the complex protocols where we face lot of issues during scripting, but HP has provided predefined correlation rules, which will help you the scripting easy.

Before recording make sure you set the following recording options:

  1. Go to Recording Options (CTRL+F7) -> Recording -> HTML-based script -> HTML Advanced and set “A script containing explicit URLs only (e.g. web_url, web_sumit_data)”.
    Siebel Recording Options 1
    Siebel Recording Options 1
  2. In, “Non HTML-generated elements (e.g. JavaScript, VBScript, ActiveX, Applets)” set “Do not Record”.
  3. Go to HTTP Properties -> Advanced node and set “clear the Reset context for each action check box”. 
    Siebel Recording Options 2
    Siebel Recording Options 2

Set the following run-time settings after recording:

Go to Run-time settings -> Browser -> Browser Emulation and set “simulate new user on each iteration”.

Siebel Runtime Settings
Siebel Runtime Settings
Some of the Common Errors in Siebel Protocol:

Back or Refresh Error:

We get error, when we pass the wrong TimeStamp or SWEC Count. For every request, the SWEC count will increase, if we pass the wrong SWEC, it will fail by throwing “Back or Refresh Error”.

Server Busy Error:

The following error is one of the common error which we get frequently during scripting and execution.

"The server you are trying to access is either busy or experiencing difficulties. Please close the Web browser, open a new browser window, and try logging in again.[01:55:21] "

The main cause for this the sessions might be less, we should ask for Siebel administrator to increase the sessions in the server.

The following commands will be useful to increase the sessions in the server:

srvrmgr:dev_srv1> CHANGE PARAM MAXMTsERVERS=4 FOR COMP eautoObjMgr_DB
Command completed successfully.

srvrmgr:dev_srv1> CHANGE PARAM MAXTASKS=400 FOR COMP eautoObjMgr_DB
Command completed successfully.

Web_add_header And Web_add_auto_header Usage In Loadrunner

Web_add_header:

Web_add_header function is used to add header only to HTTP request that follows it.



Example:

web_add_header("Cookie""{Cookie_ID}");
web_add_header("Pragma""no-cache");

web_url("webmail",
    "URL=http://{URL}/etc/apps/webmail/",
    "Resource=0",
    "RecContentType=text/html",
    "Referer=",
    "Snapshot=t1.inf",
    "Mode=HTML",
    LAST);

web_add_header("Cookie""{Cookie_ID}");
web_add_header("Pragma""no-cache");

web_url("webmail_3",
    "URL=http://{URL}/etc/apps/webmail/?_task=mail&_action=getunread&_remote=1&_unlock=0&_={TimeStamp}",
    "Resource=0",
    "RecContentType=text/plain",
    "Referer=http://{URL}/etc/apps/webmail/?_task=mail",
    "Snapshot=t2.inf",
    "Mode=HTML",
    LAST);

web_add_auto_header:

Web_add_auto_header function is used to add header to all the consecutive HTTP requests.

Web scripts usually send the standard header requests automatically for each request. If you need additional headers to be sent then you can use web_add_header or web_add_auto_header.

web_add_header only sends to the HTTP request that follows it, whereas web_add_auto_header sends to all the succeeding requests.

Web_add_header and web_add_auto_header is automatically generated in your script, if you enable this in Record -> recording options->Advanced->Headers->Record Headers not in list.

Example:

web_add_auto_header("Cookie""{Cookie_ID}");
web_add_auto_header("Pragma""no-cache");

web_url("webmail",
    "URL=http://{URL}/etc/apps/webmail/",
    "Resource=0",
    "RecContentType=text/html",
    "Referer=",
    "Snapshot=t1.inf",
    "Mode=HTML",
    LAST);

web_url("webmail_3",
    "URL=http://{URL}/etc/apps/webmail/?_task=mail&_action=getunread&_remote=1&_unlock=0&_={TimeStamp}",
    "Resource=0",
    "RecContentType=text/plain",
    "Referer=http://{URL}/etc/apps/webmail/?_task=mail",
    "Snapshot=t3.inf",
    "Mode=HTML",
    LAST);