51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

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

[原创] 请问怎样将已经存到QC当中的QTP脚本,直接批量另存到本地?

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2011-8-24 20:17:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
一个一个的打开再另存为本地,实在是太麻烦了!可不可以批量另存?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2011-10-19 15:39:16 | 只看该作者
求助啊!两个月了,难道真的不能实现么?难道真的要向HP提意见了?
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2011-12-6 09:57:58 | 只看该作者
同求,的确是个很麻烦的问题
回复 支持 反对

使用道具 举报

该用户从未签到

4#
发表于 2011-12-6 11:18:10 | 只看该作者
本帖最后由 木卫十二 于 2011-12-6 11:19 编辑

查了下,可以通过类似如下的脚本实现(在帮助文档中找checkout Method)。但不知道库文件能否用这种自动化的方式实现上传下载?

因为库文件很多,在QC上修改很不方便。

  1. '************************************************************************************************************************
  2. 'Description:
  3. '
  4. 'This example connects to a Quality Center project, opens a test (checks it out, if applicable),
  5. 'updates the Active Screen values and test object descriptions, and, if applicable,
  6. 'checks the modified test back into the Quality Center project.
  7. '
  8. 'Assumptions:
  9. 'The test1 test is not already checked out.
  10. 'There is no unsaved test currently open in QuickTest.
  11. 'For more information, see the example for the Test.SaveAs method.
  12. 'When QuickTest opens, it loads the add-ins required for the test.
  13. 'For more information, see the example for the Test.GetAssociatedAddins method.
  14. '************************************************************************************************************************

  15. Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
  16. Dim qtUpdateRunOptions 'As QuickTest.UpdateRunOptions ' Declare an Update Run Options object variable
  17. Dim qtRunResultsOptions 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable
  18. Dim blsSupportsVerCtrl ' Declare a flag for indicating version control support

  19. Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
  20. qtApp.Launch ' Start QuickTest
  21. qtApp.Visible = True ' Make the QuickTest application visible

  22. ' Make changes in a test on Quality Center with version control
  23. qtApp.TDConnection.Connect "http://qcserver/qcbin", _
  24.               "MY_DOMAIN", "My_Project", "James", "not4you", False ' Connect to Quality Center

  25. If qtApp.TDConnection.IsConnected Then ' If connection is successful
  26.     blsSupportsVerCtrl = qtApp.TDConnection.SupportVersionControl ' Check whether the project supports version control

  27.     qtApp.Open "[QualityCenter] Subject\tests\test1", False ' Open the test
  28.     If blsSupportsVerCtrl Then ' If the project supports version control
  29.         qtApp.Test.CheckOut ' Check out the test
  30.     End If

  31.     ' Prepare the UpdateRunOptions object
  32.     Set qtUpdateRunOptions = CreateObject("QuickTest.UpdateRunOptions") ' Create the Update Run Options object
  33.     ' Set the Update Run options: update the Active Screen and test object descriptions. Do not update checkpoint values
  34.     qtUpdateRunOptions.UpdateActiveScreen = True
  35.     qtUpdateRunOptions.UpdateCheckpoints = False
  36.     qtUpdateRunOptions.UpdateTestObjectDescriptions = True

  37.     ' Prepare the RunResultsOptions object
  38.     Set qtRunResultsOptions = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
  39.     qtRunResultsOptions.ResultsLocation = "<TempLocation>" ' Set a temporary results location

  40.     'Update the test
  41.     qtApp.Test.UpdateRun qtUpdateRunOptions, qtRunResultsOptions ' Run the test in Update Run mode
  42.     qtApp.Test.Description = qtApp.Test.Description & vbNewLine & _
  43.                               "Updated: " & Now ' Document the update in the test's description (Test Settings > Properties node)

  44.     qtApp.Test.Save ' Save the test

  45.     If blsSupportsVerCtrl And qtApp.Test.VerCtrlStatus = "CheckedOut" Then ' If the test is checked out
  46.         qtApp.Test.CheckIn ' Check it in
  47.     End If

  48.     qtApp.TDConnection.Disconnect ' Disconnect from Quality Center
  49. Else
  50.     MsgBox "Cannot connect to Quality Center" ' If connection is not successful, display an error message.
  51. End If

  52. qtApp.Quit ' Exit QuickTest
  53. Set qtUpdateRunOptions = Nothing ' Release the Update Run Options object
  54. Set qtRunResultsOptions = Nothing ' Release the Run Results Options object
  55. Set qtApp = Nothing ' Release the Application object



复制代码
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-10-3 00:26 , Processed in 0.089106 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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