第一篇:QTP 和QC 的整合 - 运行结束后自动提交bug的方法
QTP 和QC 的整合-运行结束后自动提交bug的方法 上一篇 / 下一篇 2008-08-09 15:08:50 / 个人分类:测试流程 查看(133)/ 评论(1)/ 评分(0 / 0)
在自动化测试过程中,发现问题需要对其进行保存和提交,下面是利用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