Geeks Talk

Prepare for your Next Interview




about qtp

This is a discussion on about qtp within the QTP forums, part of the Software Testing category; can i run my script by command prompt with out intalling qtp at one side?...


Go Back   Geeks Talk > Software Testing > QTP

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 02-06-2007
Junior Member
 
Join Date: Jan 2007
Location: chennai
Posts: 26
Thanks: 4
Thanked 2 Times in 2 Posts
aarusa is on a distinguished road
about qtp

can i run my script by command prompt with out intalling qtp at one side?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-16-2007
yan yan is offline
Junior Member
 
Join Date: May 2006
Location: Tel Aviv ,Israel
Posts: 7
Thanks: 0
Thanked 2 Times in 2 Posts
yan is on a distinguished road
Re: about qtp

hi,
1)create a vbs file
2)add this code :

Dim App

Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = True ' can be True or false

' Load an .ini file with the user-defined parameters.
App.Test.Environment.LoadFromFile "C:\Test_Params\environment_file1.ini"

' Declare an array with the paths and names of the tests.
dim testArray(3)

testArray(1) = "C:\Program Files\Mercury Interactive\QuickTest Professional\Tests\mytest"
testArray(2) = "C:\Program Files\Mercury Interactive\QuickTest Professional\Tests\mytest2"
testArray(3) = "C:\Program Files\Mercury Interactive\QuickTest Professional\Tests\mytest3"

Set qtResultsObj = CreateObject("QuickTest.RunResultsOptions")

' Loop through all the tests in the testArray.
for i = 1 to UBound (testArray)

' Open the test in QuickTest Professional.
App.Open testArray(i), True

' Get the test object.
Set qtTest = App.Test

' Set the test results options. Here the location for the test results will be set.
qtResultsObj.ResultsLocation = testArray(i) & "\Res1" ' Set the results location

'Execute the test. Instruct QuickTest Professional to wait for the test to finish executing. ' This statement specifies a test results location.
qtTest.Run qtResultsObj, True

' Run the script using the default test results options.
qtTest.Run

' Close the test.
qtTest.Close 'Close the test
next

' Close QuickTest Professional.
App.Quit

' Release the created objects.
set qtResultsObj = nothing
set qtTest = nothing
set App = nothing
3)save the vbs file and close it.(c:\work\runQTP.vbs)
4)goes to the remote machine and open the command line.
5)write the path of the qtp machine and add ""c:\work\runQTP.vbs"
6) this should work
let me know if it's working for you.
Yan , Tel-Aviv

Last edited by yan : 02-16-2007 at 07:06 PM.
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP


Thread Tools
Display Modes



All times are GMT -4. The time now is 01:23 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