当前位置: 代码迷 >> vbScript >> qc 二次开发 用 VBScript 下传附件
  详细解决方案

qc 二次开发 用 VBScript 下传附件

热度:915   发布时间:2012-11-15 15:16:14.0
qc 二次开发 用 VBScript 上传附件
Public Function AddAttachmentOnQC(TestObject, FileName)
On Error Resume Next
'通过AddItem(Null)方法取得Attachment对象
Set AttachmentFactory = TestObject.Attachments
Set Attachment = AttachmentFactory.AddItem(Null)
'上传文件并更新
Attachment.FileName = FileName
Attachment.Type = 1
Attachment.Post
Attachment.Refresh
AddAttachmentOnQC = True
'错误情况处理
If Err.Number <> 0 Then
Err.Clear
GetAttachmentOnQC = False
wscript.echo "false"
On Error GoTo 0
else
wscript.echo "true"
End If
End Function


Set tdconnction = CreateObject("TDApiOle80.TDConnection")
tdconnction.InitConnectionEx "http://lab11:8888/qcbin"
tdconnction.ConnectProjectEx "DEFAULT","QualityCenter_Demo","alex_qc",""
Set BugFact = tdconnction.BugFactory
Set TestObject = BugFact.Item(1)
AddAttachmentOnQC TestObject, "F:\a\复件 BUG_32_Transaction Response Time.xls"
  相关解决方案