当“TC_STATUS”“失败”时,我想从TestSet的执行网格中打开缺陷窗口
以下代码似乎仅在我执行“完整”运行时才起作用
Actions.Action("Defects.NewDefect").Execute
或
Actions.Action("StepsView.NewDefect").Execute
我已经尝试过:
Actions.Action("TestSetView.NewDefect").Execute
但这没有任何作用
答案 0 :(得分:0)
每次更改测试实例状态时,您都可以自动发布新缺陷,并将此新缺陷链接到当前选定的测试实例。
在Test Lab模块脚本工作流程中输入以下代码:
Sub TestSetTests_FieldChange(FieldName)
On Error Resume Next
If FieldName = "TC_STATUS" and TestSetTest_Fields.Field("TC_STATUS").Value = "Failed" Then
Set BugFact = TDConnection.BugFactory
Set NewBug = BugFact.AddItem(null)
'Fill new defect fields
NewBug.Summary = "New Defect"
NewBug.Field("BG_SEVERITY") = "3-High"
NewBug.Field("BG_STATUS") = "New"
NewBug.Field("BG_DETECTION_DATE") = "2016-01-01"
'...
NewBug.Post()
TestInstanceId = TestSetTest_Fields.Field("TC_TESTCYCL_ID").Value
Set TestInstanceFact = TDConnection.TSTestFactory
Set TestInstance = TestInstanceFact.Item(TestInstanceId)
Set NewBugLinkFact = TestInstance.BugLinkFactory
Set NewBugLink = NewBugLinkFact.AddItem(null)
NewBugLink.TargetEntity = NewBug
NewBugLink.Post
End If
On Error GoTo 0
End Sub
或者,如果您正在使用ALM 12.53,则可以尝试从所有模块执行标头“新缺陷”操作。
Actions.Action("HeaderActions.HeaderNewDefect").Execute