51Testing软件测试论坛

标题: 从QTP中运行脚本向TD增加defect例子,defect并没有增加进去 高手解答下 [打印本页]

作者: xqgogopp    时间: 2007-12-7 11:39
标题: 从QTP中运行脚本向TD增加defect例子,defect并没有增加进去 高手解答下
Dim TDConnection
Set TDConnection = CreateObject("TDApiOle.TDConnection")
TDConnection.InitConnection "http://linkage-renxq/tdbin" ' URL for the DB
TDConnection.ConnectProject "TestDirector_Demo_0","admin","" ' Valid login information

If TDConnection.Connected Then
  MsgBox("Connected to " + chr (13) + "Server " + TDConnection.ServerName _
  + chr (13) +"Project " + TDConnection.ProjectName )
Else
  MsgBox("Not Connected")
End If

'Get the IBugFactory
Set BugFactory = TDConnection.BugFactory

'Add a new empty bug
Set Bug = BugFactory.AddItem (Nothing)

'fill the bug with relevant parameters
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 list
Bug.DetectedBy = "admin" ' user that must exist in the DB's users list

'Post the bug to DB ( commit )
Bug.Post
执行的时候能够出现连接成功的提示框,但是在TD中并没有找到新增的defect
Results.qtp如下:
[T1]
Indent=0
EventType=StartRepLog
Type=HTML
NodeName=Incompatibility Error
IconIndex=1
Status=Done
Iteration=1
ReplayId=2
BottomFile=InstallNewReport.html
TopFile=
[General]
Total=1
Title=Incompatibility Error
作者: 51mobile    时间: 2007-12-7 13:00
关注高手回答




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2