[转]QTP提交BUG到TD/QC
上一篇 /
下一篇 2010-12-06 16:35:44
/ 个人分类:QTP
AddDefectTo QC fromQTPthat use the QCUtil.QCConnection sub
执行时,有时我们可能想直接向QC/TD中添加defect, 下面是具体代码
' ==================================================================================
' description : Add Defect To QC from QTP that use the CUtil.QCConnection sub ,This code page9 b6 v$ r# Z) S5 J0 s! z1 a
' from manual , It working fine On TD8.2 and qtp10.00 5 d. S7 _9 R5 E
' Questtion: can not support bug.description? resolve - - bug.field("DB_field") = "value",
' date : 2009-10-19
' Author : namesliu
' Note: This property is supported only when QuickTest is connected to Quality Center.4 F& b, ~% q, Q7 K. _4 D L G
' ==================================================================================$ w+ d/ T" f; q- `& X
Dim QCConnection
Set QCConnection = QCUtil.QCConnection 'Note: This property is supported only when QuickTest is connected to Quality Center.
'Get the IBugFactory
Set BugFactory = QCConnection.BugFactory$ v" a& B B& J' ?3 d
'Add a new, empty defect% n. U e" p- S* K/ V' E. }* f
Set Bug = BugFactory.AddItem (Nothing)
'Enter values for required fields+ p% a S" N: F7 k1 o: ]: R
Bug.Status = "New"
Bug.Summary = "New defect") i3 E% e+ x$ `2 N
Bug.DetectedBy = "namesliu" ' user that must exist in the database's user list. e+ Q6 Z) U2 x
BUG.field ("bg_DETECTION_DATE") = now# T; d# _2 V' f+ }, |: z$ Z1 g3 U) _+ s
' Bug.description will be erro, bug.field("bg_description") is correct, so bug.filed is field in DB" W; s5 b2 P `
bug.field("bg_description") = " the bug detected by QTP!"
Bug.Post 'Post the bug to the database ( commit )
收藏
举报
TAG: