第一篇:QTP 和QC 的整合 - 運行結(jié)束后自動提交bug的方法
QTP 和QC 的整合-運行結(jié)束后自動提交bug的方法 上一篇 / 下一篇 2008-08-09 15:08:50 / 個人分類:測試流程 查看(133)/ 評論(1)/ 評分(0 / 0)
在自動化測試過程中,發(fā)現(xiàn)問題需要對其進行保存和提交,下面是利用qtp的自動提交缺陷到qc中,代碼如下:
Dim TDConnection
Set TDConnection = CreateObject(“TDApiOle.TDConnection”)
TDConnection.InitConnectionEx “"
TDConnection.Login ”pcl“, ”“
TDConnection.Connect ”深圳博為峰信息有限公司“, ”mis“
If TDConnection.Connected Then
MsgBox(”Connected to “ + chr(13)+ ”Server “ + TDConnection.ServerName+ chr(13)+”Project “ + TDConnection.ProjectName)
Else
MsgBox(”Not Connected“)
End If
Set BugFactory = TDConnection.BugFactory
Set Bug = BugFactory.AddItem(Nothing)
Bug.Status = ”New“
Bug.Summary = ”Connecting to TD“
Bug.Priority = ”4-Very High“ ' depends on the DB
Bug.AssignedTo = ”admin“ ' user that must exist in the DB's users listBug.DetectedBy = ”admin" ' user that must exist in the DB's users listBug.Post
set Bug=nothing
set TDConnection =nothing