Tuesday, April 14, 2015

VUGen Not Recording Applications Running on Chrome

Problem StatementDuring testing we might encounter situations where some of the web-applications are supported only on Chrome not on IE / Firefox. In these situations we might ask whether LR will support recording of Chrome application(s) if so then what version it supports and whether any tweaks needed to resolve any issues.

Solution


If you are using LR 11.0 then you might face issues where Chrome will be launched but the suddenly chrome behaves very slow and becomes non-responsive. While manually the same application runs fine without any issues, to fix this you can apply the necessary LR patches and re-record the flow.
If the issue persists then you can download the latest bbhook.dll from HP Support and perform the following:


  • Go to [Vugen / LR] Install dir -> Bin folder and take a backup of the bbhook.dll and replace it with the new one.
  • Go to [Vugen / LR] Install dir -> config folder and open the vugen.ini file using notepad (or textpad)
  • At the end of the file add the below 2 lines
    [NoTrap]
    Application1=chrome.exe
  • save the vugen.ini file and then copy it to "C:\Windows" folder
  • Restard Vugen.
If you are using LR 11.5; it has Chrome support till ver 25; if you are using higher version of chrome then you might face issues in recording... to avoid these you can either install chrome version 25 or install latest LR patches. 

Another workaround is to record the Application using LR Proxy available with LR 11.5 where LR will work as a proxy (listening on port 8888); you can change the proxy settings in chrome browser and navigate your flows / scenarios. Events will get recorded and script will be generated in VUGen.

During recording of a HTTPS page with chrome browser you face an recording error which says "Alternate-Protocol: 443:quic"; currently both LR 11.x and 12.x doesn't support QUIC and you have to use other browsers which doesn't support QUIC like IE and Mozilla.

Hope this was helpful in resolving your issues.


VUGen replay errors for HTTPS sites

Problem Statement: Now as most of the sites are migrating to HTTPS; during replay of these application(s) / sites you might see some errors as mentioned below; you can follow the solutions given to resolve the same.

Solution:

Below are a list of Errors encountered and their resolutions for the same:
Error: "--27776: Server "[server_name]" shut connection during attempt to negotiate SSL session"
To resolve this issue, you can reduce the amount of connections simultaneously opened to a Web server by using the following statement in the script:
web_set_sockets_option("MAX_CONNECTIONS_PER_HOST","1");
Also, make sure that Keep-Alive is set to "No." This setting can be found via Run-Time Settings -> Preferences -> Options -> Keep-Alive HTTP Connections.

Error: "Error -27781 Timeout in state STATE_SSL_CONNECT "
Error: -27778 : SSL protocol error when attempting to read with host

There are some possible work-around for the above 2 errors, you need to check which one (or combination) works for you:
1. Add the following statement to the beginning of the script:
        web_set_sockets_option("SSL_VERSION", "3");
You can check the SSL Version in your recording log of the script, it can be TLSv1.1 / 1.2 or SSL3; accordingly you can change the command mentioned above.

2. Add web_set_sockets_option("MAX_CONNECTIONS_PER_HOST","1"); at the very beginning of the script.

This forces a single connection to the server thus eliminating the possibility of the server prematurely shutting down an existing connection and causing errors when LoadRunner sends data using that connection.

3. Disable webpage breakdown if HTTPS protocol (SSL) is being used and there is a proxy server in-between the client (LoadRunner) and the server under test. To disable webpage breakdown from the Controller:

   a. Go to Diagnostics->Configuration.
   b. Select "Disable" tab for "Web Page Diagnostics"
   c. Click "OK" to close the diaglogue to complete the setup

4. If you have generated your script using WinInet options then use the WinInet Replay engine. To do so, go to Run-Time Settings -> Preferences -> Select "WinInet Replay Engine instead of Sockets (Windows Only)."

Error: "SSL State: error in SSLv3 write client certificate B..." while replaying in Socket mode
Error: "SSL protocol error when attempting to connect with host" while replaying a Web protocol script

Add all of the certificates in the certificate hierarchy for the SSL certificate to a .pem file (e.g. certFile.pem) and include this .pem file by adding the following line at the beginning of the script:
web_set_certificate_ex( "CertFilePath=certFile.pem", "CertFormat=PEM", ...LAST);
web_set_sockets_option("LOAD_VERIFY_FILE", "certFile.pem");

Error -27791 : "server name" has shut down the connection prematurely

To Resolve this, you can try adding the below command:
web_set_sockets_option("MAX_CONNECTIONS_PER_HOST","1"); at the very beginning of the script.
If you still get the same error then you can try the below command (add it after the previous one):
web_set_sockets_option("IGNORE_PREMATURE_SHUTDOWN", "1")

Error: SSL protocol error when attempting to connect with host "xxx"

Try to check the certificate and connection using openssl with this sentence from CMD:
                       openssl s_client -connect :2443
               or
                       openssl s_client -connect :443

This will show the certificate information. If not, application has a certificate problem and need to check with application owners / server admins.