Monday, June 14, 2010

Run QTP from Java

Let start with the simplest QTP script, which have only one statement that will print "Hello World" to the console



I saved this QTP Script as "Hello" script.
Then I run this QTP from Java using QTPUtil library.

QTPUtil.callQTPTest(false, "resources/QTP_Scripts/Hello");




The QTPUtil.callQTPTest method take in two parameters. The first one is the flag indicate whether we want QTP to be visible or not, the second one is the path to the QTP script. The path to QTP script can be absolute or relative. In this example I'm using the relative path.

7 comments:

  1. Hi;
    please tell me that where u got the package junit4qtp.core.QtpUtil if it is a jar file can u please share the jar file or give me the path so i downloaded it
    if it is not a jar file than from where u got this package

    ReplyDelete
  2. have u written your own QTP framework that u are use in your java program?

    ReplyDelete
  3. Where are the required jar files wiht the QTP related classes?

    ReplyDelete
  4. Please can you share the package junit4qtp
    Thanks

    ReplyDelete
  5. Hello, please, where are de .jar of class QTPUtil?, what is the url to download it?. Thx.

    ReplyDelete
  6. Hello Sir,

    Can you please provide me the path for junit4qtp package ??

    ReplyDelete
  7. Are you kidding me..There is no jar for invoking QTP. I searched it all over the internet.
    Do fool around if you have one, share it

    ReplyDelete