Geeks Talk

Prepare for your Next Interview




QTP : executing test from commandline

This is a discussion on QTP : executing test from commandline within the QTP forums, part of the Software Testing category; 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 ...


Go Back   Geeks Talk > Software Testing > QTP

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 12-12-2006
Junior Member
 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
code_x is on a distinguished road
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.
Reply With Quote
The Following User Says Thank You to code_x For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 10-09-2007
Contributing Member
 
Join Date: Sep 2007
Location: Hyderabad
Posts: 93
Thanks: 1
Thanked 14 Times in 13 Posts
rajaputra is on a distinguished road
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:/"

systemutil.run "c:\program files\mercury interactive\quicktest professional\samples\flight\app\flight4a.exe
dialog("text:=Login").activate
dialog("text:=Lgin").winedit("attached text:=Agent Name:").set "rajaputra"
dialog("text:=Login").winedit("attached text:=Password:").set "mercury"
dialog("text:=Login").winbutton("text:=OK").click

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 02:29 PM.
Reply With Quote
  #3 (permalink)  
Old 10-18-2007
Contributing Member
 
Join Date: Feb 2006
Posts: 73
Thanks: 0
Thanked 3 Times in 3 Posts
kunals is on a distinguished road
Re: QTP : executing test from commandline

You can use the following piece of code

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

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

Thanks,
Kunal.
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP


Thread Tools
Display Modes



All times are GMT -4. The time now is 05:14 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved