vbs调用QTP

上一篇 / 下一篇  2008-11-13 14:19:40 / 个人分类:QTP

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")' 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.Open "C:\ Your Test Path Here", True' Open the test in read-only mode

' set run settings for the test
Set qtTest = qtApp.Test
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:\Your Results Path Here"' Set the results location

qtTest.Run' Run the test

'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


TAG: QTP

 

评分:0

我来说两句

日历

« 2024-05-06  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 20588
  • 日志数: 32
  • 建立时间: 2007-12-13
  • 更新时间: 2008-12-04

RSS订阅

Open Toolbar