Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Run QTP Test using VBscript
#1
Solved: 11 Years, 3 Months, 1 Week ago
Hi I am using QTP to test windows application.
I have created test1 with 10 action action1 , action2 .. action 10

Now I am running test using VB script.
By default its start with Action1.

however I want to run action order specify by me on the fly using vbscript.

Some times I want to run Action 2 and Action 10 and some time Action 1 and Action 10 like that its depend of condition.

here is my vbscript

Code:
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtOptions 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create a 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 = True




' Open the test
qtApp.Open "C:\Tests\Test1\Test1", False ' Open a test named "Test1"

Set qtOptions = CreateObject("QuickTest.RunResultsOptions") ' Create a Results Option object
qtOptions.ResultsLocation = "C:\Tests\Results\" ' Set the Results location to temporary location

' 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 = 1
'qtTest.Settings.Run.EndIteration = 1
qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs

[i]'  [u]qtTest.RunAction "Action1",oneIteration[/u] I need some thing like this. but dont know how to use.[/i]

qtApp.Test.Run qtOptions, True ' Run the test and wait for it to finish before continuing the automation script


qtApp.Test.Save ' Save the test

qtApp.Quit ' Exit QuickTest
Set qtOptions = Nothing ' Release the Run Results Options object
Set qtApp = Nothing ' Release the Application object
Reply


Messages In This Thread
Run QTP Test using VBscript - by riteshgpt - 04-08-2010, 09:55 PM
RE: Run QTP Test using VBscript - by Saket - 04-09-2010, 12:01 PM
RE: Run QTP Test using VBscript - by riteshgpt - 04-09-2010, 03:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Send automatic email notification when test run started helmzshelmz 0 1,034 04-03-2020, 07:54 AM
Last Post: helmzshelmz
  How to find and change text in PDF document using QTP UFT automation VBscript alexwhite 0 12,029 02-18-2017, 04:20 AM
Last Post: alexwhite
  Error while opening test run results vkalyankar 3 4,270 11-12-2014, 09:49 AM
Last Post: vinod123
  Hyperlink click is not automated in UFT 11.5 test run prinju 1 2,764 11-03-2014, 12:04 PM
Last Post: vinod123
  Test run cannot continue oak 1 4,819 11-03-2014, 10:54 AM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 2 Guest(s)