Results 1 to 3 of 3

Thread: QTP : executing test from commandline

  1. #1
    Junior Member
    Join Date
    Dec 2006

    Unhappy QTP : executing test from commandline

    I am trying to run the QTP from commandline. I managed to execute QTP through commandline but I got as far as opening the QTP application and unable to start the specific test. I found in one of the posts that I need to create the vbs file which I can execute through the batch file. I need to execute specific test. I am not sure what exactly needs to be included in the vbs file since each test folder contains lots of different files.
    Can anyone help me found solution or post some working sample code?

    THANKS for any suggestions.

  2. #2
    Expert Member
    Join Date
    Sep 2007

    Re: QTP : executing test from commandline

    Simple.. Just type the filename (vbscript name) without extension (.vbs) in the commandprompt.
    (u have to type in the directoty where .vbs file is stored)
    for example,type this script in notepad and save (login.vbs) it in "c:/" "c:\program files\mercury interactive\quicktest professional\samples\flight\app\flight4a.exe
    dialog("text:=Lgin").winedit("attached text:=Agent Name:").set "rajaputra"
    dialog("text:=Login").winedit("attached text:=Password:").set "mercury"

    save the notepad as login.vbs in c:/ and close notepad

    open commandprompt and type login in c:/

    That is. I think U got it. Reply me if u r.

    Last edited by rajaputra; 10-09-2007 at 01:29 PM.

  3. #3
    Contributing Member
    Join Date
    Feb 2006

    Re: QTP : executing test from commandline

    You can use the following piece of code

    Set qtApp= CreateObject("QuickTest.Application")
    qtApp.Visible = True
    'Set objExplorer = CreateObject("InternetExplorer.Application")
    'objExplorer.Navigate "GIVE URL HERE"
    qtApp.Open "C:\Automation\Scripts\" 'PATH WITH SCRIPT NAME HERE

    you can call open and run as many times you want and call many script which will work as a batch run.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.