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.

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.

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.

Step 3

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

Step 4

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

Step 5

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

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.

Step 7

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


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 Performance Testing on HDFC

If users accessing HDFC site from desktop, URL of the HDFC is , but if the user access HDFC from his mobile, URL of the HDFC will be 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

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


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

  • Second request is from iPhone 4S, so LoadRunner redirected to 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 “” (redirection depth is 0)                 [MsgId: MMSG-26694]

Action.c(5): To location “”    [MsgId: MMSG-26693]

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


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.

1 thought on “Compatibility Testing using HP LoadRunner”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Learn Apache JMeter for free. No Strings Attached.Watch Now for FREE
+ +
Share via
Copy link