51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 3492|回复: 3
打印 上一主题 下一主题

[求助] 紧急求助~!关于QuickTest Automation 的问题。。

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-10-19 14:51:18 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
5测试积点
我想通过vbs调用QTP并且实现保存执行的录像。。在帮助中查到object.MovieCaptureForTestResults。。可是为什么我吧他的例子直接拷贝过来,执行时在qtApp.Options.Run.MovieCaptureForTestResults = "OnWarning"一行会报“对象不支持此属性和方法”的??

  1. Dim qtApp 'As QuickTest.Application ' Declare the Application object variable

  2. Dim qtTest 'As QuickTest.Test ' Declare a Test object variable

  3. Dim qtMovieOpts 'As QuickTest.ScreenRecorderOptions ' Declare a Run Results Options object variable

  4. Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable



  5. Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object

  6. qtApp.Launch ' Start QuickTest

  7. qtApp.Visible = True ' Make the QuickTest application visible



  8. ' Set QuickTest movie options

  9. qtApp.Options.Run.MovieCaptureForTestResults = "OnWarning" 'Set QuickTest to capture movie segments of each error and warning

  10. qtApp.Options.Run.SaveMovieOfEntireRun = "FALSE" 'Save only the movie segements that lead up to an error or warning

  11. qtApp.Options.Run.MovieSegmentSize = "4000" 'Set each movie segment to be a maximum of 4MB.





  12. Set qtMovieOpts = qtApp.Options.Run.ScreenRecorder ' Create a Screen Recorder Options object



  13. 'Set movie recording preferences to minimize the movie file size

  14. qtMovieOpts.DeactivateShowWindowContents = True

  15. qtMovieOpts.RecordSound = False

  16. qtMovieOpts.SetPlainWallpaper = True





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



  18. ' set run settings for the test

  19. Set qtTest = qtApp.Test

  20. qtTest.Settings.Run.IterationMode = "oneIteration" ' Run one iteration of the test

  21. qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when an error occurs



  22. Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object

  23. qtResultsOpt.ResultsLocation = "C:\Tests\Test1\Res1" ' Set the results location



  24. qtTest.Run qtResultsOpt ' Run the test and record a movie of the run.



  25. qtTest.Close ' Close the test



  26. Set qtResultsOpt = Nothing ' Release the Run Results Options object

  27. Set qtTest = Nothing ' Release the Test object

  28. Set qtApp = Nothing ' Release the Application object
复制代码

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2010-10-19 15:03:32 | 只看该作者
up
回复

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2010-10-19 17:26:55 | 只看该作者
up
回复

使用道具 举报

该用户从未签到

4#
发表于 2010-10-19 17:28:07 | 只看该作者
静待佳音
回复

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-26 06:37 , Processed in 0.062096 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表