Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

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 Blogs FAQ Tag Cloud 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
Expert Member
 
Join Date: Sep 2007
Location: Hyderabad
Posts: 115
Thanks: 1
Thanked 19 Times in 15 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 01:29 PM.
Reply With Quote
  #3 (permalink)  
Old 10-18-2007
Contributing Member
 
Join Date: Feb 2006
Posts: 85
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -4. The time now is 10:27 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved