How to execute QTP script from LoadRunner?

How to execute QTP script from LoadRunner?

I'm a big fan of LoadRunner! Really. This is a wonderful tool for load and performance testing.
Also, I like QTP. Not love it, just like :) It's powerful enough.

That's why I decided to use them together - i.e. execute QTP script from LoadRunner.

I recorded simple QTP script - it just opens Google, performs search, then it clicks 'Next' button, and closes browser:
QTP script is quite clear, I hope :)


But I faced the questions:
  • Should QTP be installed or not?
  • Can several QTP scripts be executed simultaneously on one computer?
  • Is it required special license for QTP and/or LoadRunner?
  • How to do that - hotw to execute QTP script from LoadRunner?
  • and others questions...
It's OK :) I will share my experience and help you to answer these questions!
Let's sort them out one after another...

  1. Should QTP be installed or not?
    The answer is 'Yes'.

    If you plan to execute QTP scripts, QTP should be installed on Load Generator computer (or computers, if you to execute several concurrent QTP scripts).

    I tried to execute QTP script on computer, where QTP was not installed, and I got this error:


  2. Can several QTP scripts be executed simultaneously on one computer?
    Actually, answer is 'Yes and No' :)
    I will explain...

    How does QTP work? It takes full control on GUI desktop of computer. Each computer has one desktop only.
    That's why there is a limitation: you can run one QTP script per computer!

    Certainly, I tried to execute two QTP scripts on one Load Generator. One user passed successfully and second generated the error:
    That means, that limitation (one QTP script per computer) works.

    But you can evade this restriction - use Terminal server or Citrix server. They allow to create several virtual desktops. And you will be able to execute several QTP scripts on one physical computer.

    I think, I explained my answer 'Yes and No' to above question :)

  3. Is it required special license for QTP and/or LoadRunner?
    • To run QTP script itself you have to have QTP license - seat or concurrent license.
    • To run QTP script from LoadRunner you have to have "GUI" Vuser LoadRunner license.

    Since you have both QTP and LoadRunner licenses, it's expensive enough to run QTP scripts from LoadRunner.

    Note: Each QTP instance should have its license. If you use concurrent licenses and plan execute 10 QTP scripts, then each QuickTest will require license - You should provide 10 seat or concurrent licenses.
    I think, it is logical.

  4. How to do that - how to execute QTP script from LoadRunner?
    Yeah! The most interested question :)

    The steps are:
    1. Record and save QTP script.
      You saw my recorded simple QTP script. I named it as 'QTP-LR'. OK
    2. Start LoadRunner Controller.
    3. Note, that QTP scripts can be executed in LoadRunner Controller. You cannot use LoadRunner Generator to run or debug QTP script.
    4. Select 'New Scenario...'.
      'New Scenario' dlg will be opened. Do not forget to select 'Quick Test Tests' from combobox:
    5. Open QTP script.
      Note, that 'Quantity' field will contain value '1', i.e. one user will be run:
      That's funny, LoadRunner set correct 'Quantity' value in Scenario Groups settings, but it forgot to set correct values in Scenario Schedule section:
      It seems like a small bug :)

    6. Execute scenario.
      You will find that your QTP script works - it will be starting a browser, performing search, clicking 'Next' btn and closing browser during 5 minutes (default time from Global Schedule settings)

      Congratulation! QTP script runs from LoadRunner.

      As you can see - there is nothing difficult :)


      Thank you for your attention, my dear reader.
      And feel free to ask me or suggest interesting subjects for further articles.

      --
      Dmitry Motevich



Related articles:

46 comments:

Anonymous said...

Its an excellent article to know about the intercommunication among different tools to put less effort manually. thanks Dimtry for taking pains to explain all these ..

Suresh chowdary said...

Its an excellent article to know about the intercommunication among different tools to put less effort manually. thanks Dimtry for taking pains to explain all these ..

Rose said...

It is a very good explanation about the QTP and LoadRunner.
Thank you so much for giving such a good things

Dmitry Motevich said...

2 Anonymous, Suresh Chowdary, and Rose:
Thank you for your comments :)

Anonymous said...

It is really helpful article.
I am working on web application where I am using java applet for uploading photos.
But load runner is not recording those java applet events.
Could you please help in this area?

Satish said...

Hi,
Thank you very much for your valuable article.

I hav few queries related to that...
1. While Executing QTP script from Loadrunner, do i need any setting to be made in loadrunner...?
2. Can we use Loadrunner Functions in QTP script...?

Anita said...

it is very helpful articule about how to run QTP scripts on LoadRunner. I have already tried while reading it & it did work.

Thank you very much for sharing your knowledge with us.

Anonymous said...

hi dmirt,
how to do Transaction Breakdown in loadrunner,can you provide a visual example on it

Thanks in advance
Anil

vicky said...

is there any tool to cerate the loadrunner script or could we using QTP scripts for LR transactions...

Dmitry Motevich said...

2vicky:
Yes, there is such tool to cerate the loadrunner script. This is HP LoadRunner.
As for "QTP scripts for LR transactions" - sorry, I couldn't understand your question.

Manu said...

The above way works for QTP.BUt when I am trying to run the same script from remote machine(as load generator),nothing is happening.Is there any other setting that needs to be done .
On both machines, application as well as QTP is installed

Dmitry Motevich said...

2 Manu:
I didn't execute QTP script on remote computers. What error do you get from LoadRunner?

vikingmn said...

I tried to run QTP script on LoadRunner, but I do not see the option for QTP format when tried open it up on LoadRunner even though I have both QTP & LoadRunner licence. I did receive an error that "You do not have a license for this Vuser type.
Please contact Mercury Interactive to renew your license."

Anonymous said...

Hello Dmitri,
Thank you for the article. But I don't understand why we should use LoadRunner Controller to run QTP scripts? The number of users can be only 1 and we can choose 1 QTP script.

Thank you in advance, Irena

Dmitry Motevich said...

2Irena:
It is useful in this sitiation:
LoadRunner allows to start load testing with N virtual users and to execute QTP to check - doed site (or application) works correctly under big loading.

Anonymous said...

"You do not have a license for this Vuser type.
Please contact Mercury Interactive to renew your license."
- i got the same error. how wiLL i be abLe to get that License?

Dmitry Motevich said...

2Anonymous:
You have to contact HP sales persons to buy required license.

Anonymous said...

Hi,

After executing the QTP Scripts in Load Runner, I found the following message in Load runner Analysis
The following graphs were not created:
1. Hits per Second
2. Throughput
Is there any solution for this problem?

Thanks
Anil

anjanku said...

Hi Dmitry,

While trying to execute QTP script from Loadrunner it gives error saying "You do not have a license for this Vuser type". I checked licenes I have vuser licenese for WEB 2.0 Bundle and All monitors. How do I know which vuser type license I need ? Is there any link that explains this vuser type?

Thank You.

Dmitry Motevich said...

2Akanku:
You should have QTP licenses

Dmitry Motevich said...

2Anil (June 5, 2008 10:29 AM):
As I remember this data cannot be gathered during running of QTP tests from LoadRunner.
QTP performs functional testing and it does not collect load-testing metrics.
So, this is a nornal behaviour.

Sandy said...

Hi Dmitry,

We can anyways run QTP Scripts with "QTP" itself. We can even schedule them with batches. Then what are the benefits of running QTP Script from Controller?

Regards,
Sandy

Trupti Tikekar said...

thanks for such a nice guidence as it will be helpful to understand a critical part.

anjanku said...

I have a clarification regarding Loadrunner Server Response time and QTP response time. QTP is capturing actual times but when I tried to capture the same using Loadrunner with 1 Vuser result is different. I am using Winsocks for my application as application communicates on TCP Port 4100. I have to use Loadrunner to simulate 50 concurrent users. I have ignored think time while recording the scenario. If you know why these two times (LR and QTP) are different please share with us.

Thanks !!

Dmitry Motevich said...

2anjanku,
QTP and LR measure different times.

LR does not measure client activity time, for example, rendering browser or opening PDF file.
QTP does.

Dmitry Motevich said...

2Sandy,
The benefit is that we can start load testing and to perform functional testing in the same time

Anonymous said...

hi sandy,
while recording script in loadrunner all server responses will be recorded.sometimes we cannot find out response for a particular object where as in qtp for a particular object only it catches script.so u can easily identify. if i'm wrong pls correct me.

Anonymous said...

Hi Dimtry,
Your Tutorial is really excellent. But the link "How to detect memory leaks with LoadRunner - visual tutorial" is seems like not taking to the correct page. Could you please check this.

Dmitry Motevich said...

Anonymous (from September 4, 2008 7:17 PM),
You are right! I've just fixed the link. It is pointing to the correct tutorial now!
Thank you very much for your attentiveness!

Dmitry Motevich said...

Anonymous (from August 12),
Could you provide more detailed info?
Which object was not recorded? Is it Java applet, ActiveX, or JavaScript?
By the way, what protocol did you use?
And why do you think that this object (its actions) should be recorded?

Anonymous said...

This is a good article. I do have a question. If we run the QTP scripts off the LR Controller; where are the results stored? Can the results be stored into a SQL database?

Anonymous said...

Hi Dmitry,

My question may sound very weird but i have this confusion in my mind so please do clarify it.
If we can perform image chk, text chk and content chk in loadrunner then it means that we can check whetehr we are going to the right page and hence we are checking functionality. So why do we need to use QTP/Winrunner because we can also chk functionality in loadrunner.

Thanks in advance.

Dmitry Motevich said...

to Anonymous (September 11),
Whose results do you mean?
QTP's or LoadRunner's results?

Anonymous said...

Hi Dmitry,

Could you please provide me the answer of my last question that is regarding difference between functional testing and Loadrunner(if we can perform web checks and content check in loadrunner then that menas that we are also checking functionality. so why cant we perform functional testing using loadrunner.) I am really confused because of this.

Naveen said...

Hi,

I am preparing for AIS Loadrunner certification. I am plannning to take HPO-M19(VU Gen Scriptin) exam first and then HPO-M18 after that.
IS it the right path?Please suggest.
Also could you provide me the HPO-M19 sample questions.

Dmitry Motevich said...

to Anonymous (September 12),
Actually, it's more simpler to perform text, image, and others UI verifications in QTP, that in LR.

For example, if you work with Web application, LoadRunner works with HTML page containing tags.
In opposite, QTP sees plain text on web pages. You don't need to parse HTML tags to get/find something on a page.

Dmitry Motevich said...

to Anonymous (September 17),
Answered

Anonymous said...

Dmitry,

Thnaks a lot for your response.
One more question, when you say test check is done by parsing html checks in LR, so are you referring to 'LB' and 'RB' that we use in text check function?
Also, if we ignore complexity issue, then can we perfrom functional testing using loadrunner also?

Dmitry Motevich said...

Naveen (September 19),
I'm afraid I cannot answer 'cause I've never tried to get LR certificate.

Anonymous said...

Dear

Please guide if you have any idea to do performance testing for Delphi Application and Oracle Loader. Which protocol to opt for these technology in LoadRunner?

Regards
JBN

Dmitry Motevich said...

to Anonymous/JBN (September 25),
Since you provided too generic info, I can give you the same answer - "Use any suitable protocol" :)

I hope, you've understood, why it's important to provide detailed description...

Mini Me said...

Hi Dmitry, Excellent article and it answered 90 % of the question I was searching an answer for. Now for the remaining 10%, can we use multiple workstations as loadgenerators, in order to meet the limitation of running one GUI Vuser per machine? Or is it mandatory to use the controller itself (localhost) as the load gen?

Dmitry Motevich said...

@Mini Me,
Sure, you can use several Load Generators. To run several QTP script on several computers, do the following steps:
1. Create several scenario groups containing QTP script.
2. Assign the only VUser for each group
3. Assign different Load Generators for above scenario groups
4. Run LR script

Anonymous said...

It is nice description but did not work in my case.Can you please explain maore as to what else do we need to have on our system to run QTP scripts in LR.

Thanks.

Anonymous said...

It is a very nice article,but in my scenario I am selecting the QuickTest tests and it does not work.These are the error messages I get.Any idea?
Error: Process "mmdrv.exe" was not created. Reason: error in parsing command line into file.

and

Error: Installation of additional environments required. Failed to read registry key:"HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\Astra LoadTest\CurrentVersion\RuntimeEnvironment".

Dmitry Motevich said...

Dear Readers!
Thank you very much for you comments!

Since this article was published more than one year ago, I've just disabled an adding of new comments for the article.