Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can we run QTP on virtual machine at scheduled time through VB script.
#3
Solved: 11 Years, 3 Months, 2 Weeks ago
Hi

Use the below code to open qtp on other machine. Paste this code in vbs file and run it

'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\


Code:
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable

Set qtApp = CreateObject("QuickTest.Application", "<REMOTEMACHINEIP or NAME>") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible

' Set QuickTest run options
qtApp.Options.Run.ImageCaptureForTestResults = "OnError"

qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False

qtApp.Open "C:\Tests\Test1", True ' Open the test in read-only mode

' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Settings.Run.IterationMode = "rngIterations" ' Run only iterations 2 to 4
qtTest.Settings.Run.StartIteration = 2
qtTest.Settings.Run.EndIteration = 4
qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs

Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = "C:\Tests\Test1\Res1" ' Set the results location

qtTest.Run qtResultsOpt ' Run the test

MsgBox qtTest.LastRunResults.Status ' Check the results of the test run
qtTest.Close ' Close the test

Set qtResultsOpt = Nothing ' Release the Run Results Options object
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object


Hope it helps

- Mr.K
Reply


Messages In This Thread
RE: How can we run QTP on virtual machine at scheduled time through VB script. - by KVK - 07-15-2009, 08:32 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Loading QRS files at Run time dvkbabu 2 10,021 03-24-2017, 09:04 PM
Last Post: UrmilaSaha
  Running UFT scripts on a remote machine with no UFT installed on the Remote machine anupam4j 0 3,033 01-21-2016, 06:48 PM
Last Post: anupam4j
  Missing Resources, Information Pane, Debug Viewer, Run time Data Table not visible Aurodeepta 3 6,976 05-28-2015, 02:52 PM
Last Post: Aurodeepta
  Object Identification not working on Run Time Ajatshatru 2 3,263 05-06-2015, 07:27 PM
Last Post: Ajatshatru
  Error while adding Object to Object repository at run time SaranKumarV 3 8,647 02-02-2015, 01:40 AM
Last Post: dubeyvin

Forum Jump:


Users browsing this thread: 3 Guest(s)