|
5测试积点
我想通过vbs调用QTP并且实现保存执行的录像。。在帮助中查到object.MovieCaptureForTestResults。。可是为什么我吧他的例子直接拷贝过来,执行时在qtApp.Options.Run.MovieCaptureForTestResults = "OnWarning"一行会报“对象不支持此属性和方法”的??
- Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
- Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
- Dim qtMovieOpts 'As QuickTest.ScreenRecorderOptions ' Declare a Run Results Options 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 movie options
- qtApp.Options.Run.MovieCaptureForTestResults = "OnWarning" 'Set QuickTest to capture movie segments of each error and warning
- qtApp.Options.Run.SaveMovieOfEntireRun = "FALSE" 'Save only the movie segements that lead up to an error or warning
- qtApp.Options.Run.MovieSegmentSize = "4000" 'Set each movie segment to be a maximum of 4MB.
-
-
- Set qtMovieOpts = qtApp.Options.Run.ScreenRecorder ' Create a Screen Recorder Options object
-
- 'Set movie recording preferences to minimize the movie file size
- qtMovieOpts.DeactivateShowWindowContents = True
- qtMovieOpts.RecordSound = False
- qtMovieOpts.SetPlainWallpaper = True
-
-
- qtApp.Open "C:\Tests\Test1", True ' Open a test in read-only mode
-
- ' set run settings for the test
- Set qtTest = qtApp.Test
- qtTest.Settings.Run.IterationMode = "oneIteration" ' Run one iteration of the test
- qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when an 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 and record a movie of the 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
复制代码 |
|