Close

December 21, 2012

Compatibility Testing using HP LoadRunner

Mobile usage is sky rocketing across the globe. It is important to test the performance and compatibility of mobile websites. There are many commercial and open source tools and solutions available in the market like HP Mobile Testing Solution, Neoload, Apache JMeter etc. In this post, we will about compatibility testing using HP LoadRunner.

In this tutorial we will discuss about one case study by considering search engine Google and banking website HDFC. In this case study on compatibility performance testing, I have used HP LoadRunner 11.

Compatibility Performance Testing on Google

In this case study, I haven’t actually loaded virtual users (VUsers).Please do not load test any live applications when you explore this case study at your desktop.

Compatibility performance testing across devices and browsers can be easily achieved by modifying user agent string in HP LoadRunner or any other tool.

First step is to record your action in HP LoadRunner. Before you execute the script, gather the user strings for Chrome and iPhone 4S by simple Google search.

Chrome 24.0.1309.0

• Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1309.0 Safari/537.17

iPhone 4S i.e. iOS 5

• Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9A405

How to modify user agent string in HP LoadRunner?

Step 1

Navigate to Vuser > Run-Time settings or simply press F4 key

Step 2

In Run-Time settings dialog box, click on Browser Emulation. In Browser Emulation options (i.e. right side), click on Change button as shown below figure.

Compatibility Testing using HP LoadRunner - Run-Time Settings - QAInsights

Step 3

By default, User-Agent dialog box will display your user agent string as shown below. To overwrite, just copy the user agent here and click on OK. In Playback, LoadRunner overwrites the default user agent string with the new one in all the requests.

Compatibility Testing using HP LoadRunner - User Agent String - QAInsights

But our aim is to compatibility performance testing in multiple browsers and devices. To achieve our objective, we need to parameterize the user agent strings.

How to parameterize user agent string in HP LoadRunner?

Step 1

Press CTRL + L or navigate to Vuser > Parameter List to create parameter.

Step 2

Parameter List dialog box opens up. Click on New button as shown below.

Compatibility Testing using HP LoadRunner - Create Parameter - QAInsights

Step 3

Type “UserAgentString” as shown below and press ENTER key.

Compatibility Testing using HP LoadRunner - Create Parameter UserAgentString - QAInsights

Step 4

Click on Create Table to create a UserAgentString.dat file as shown below.

Compatibility Testing using HP LoadRunner - Create Table - QAInsights

Step 5

Click on Edit with Notepad… and enter the user agent strings. Save it and close the notepad.

Compatibility Testing using HP LoadRunner - Edit with Notepad - QAInsights

Step 6

If you get any error, make sure you set below settings Column delimited must be Tab in Parameter List dialog box. Click on close one you are done.

Compatibility Testing using HP LoadRunner - Parameter Settings - QAInsights

Step 7

Go to the top of your script, and enter below snippet.

web_add_header(“User-Agent”,”{UserAgentString}”);

web_add_header function has two parameters, one is to mention the type of header and another one is for header value / content.

Before you execute the script, increase the iterations to 2 under Run Logic.

Below are the snapshots of Google in Chrome and iPhone 4S.

Compatibility Testing using HP LoadRunner - Google in Chrome - QAInsights

Compatibility Testing using HP LoadRunner - Google in iPhone 4S - QAInsights

Compatibility Performance Testing on HDFC

If users accessing HDFC site from desktop, URL of the HDFC is http://www.hdfc.com , but if the user access HDFC from his mobile, URL of the HDFC will be http://m.hdfc.com which means HDFC identifies the agent and redirects accordingly. Now we will analyze whether HP LoadRunner doing its job correctly.

When we simulate requests from iPhone to HDFC servers via LoadRunner, LoadRunner should redirect the requests to m.hdfc.com

Record your actions on HDFC in LoadRunner and parameterize the user agent string as shown above. Below is the observations made during the execution.

Observations:

  • First request is for Chrome which processed correctly. LoadRunner displayed how HDFC site will look in Chrome browser. See below figure.

Compatibility Testing using HP LoadRunner - HDFC in Chrome - QAInsights

  • Second request is from iPhone 4S, so LoadRunner redirected to m.hdfc.com and displayed as it is. Below are the replayed log and the snapshot.

Action.c(3): web_add_header(“User-Agent”) was successful    [MsgId: MMSG-26392]

Action.c(5): Redirecting “https://www.hdfc.com/” (redirection depth is 0)                 [MsgId: MMSG-26694]

Action.c(5): To location “http://m.hdfc.com”    [MsgId: MMSG-26693]

Action.c(5): web_url(“www.hdfc.com”) was successful, 50470 body bytes, 10819 header bytes, 11 chunking overhead bytes                  [MsgId: MMSG-26385]

Compatibility Testing using HP LoadRunner - HDFC in iPhone 4S - QAInsights

Conclusion:

Compatibility performance testing can be easily achieved by changing the user agent string. User agent string is one of the factors in compatibility performance testing. Few other factors are Bandwidth, Latency, Network simulation can be achieved only thru complete mobile testing solutions like HP Mobile Testing Solution, NeoLoad etc.

LoadRunner just helps to validate the compatibility and performance of the web applications in case we do not have complete testing tool.

I hope this article explained how to achieve compatibility performance testing using HP LoadRunner.

Happy Testing!

Thanks for visiting QAInsights!

We’re always posting interesting articles on QAInsights. I request you to subscribe so you don’t miss out anything.

Subscribe to our QAInsights YouTube Channel. Subscribe our free weekly newsletter or Google feeds.

About NaveenKumar Namachivayam

Hi there! is a passionate and experienced Performance Test Analyst based in Chicago, USA with skill sets in Manual Testing, Test Automation, Performance Testing, and Test Estimation. He loves to learn and experiment new trends and models in Software Testing. Please stop by at his personal blogs: Excel Blog, DealsBrook, NaveenKumarN.in, and Affiliate Insights blog and Software Testing Memes.

One Comment on “Compatibility Testing using HP LoadRunner

Sajid
December 22, 2012 at 7:08 pm

Thanks Naveen for this useful information.

Reply

Leave a Reply

Your email address will not be published. Required fields are marked *