2016-06-27 43 views
0

我想從測試集的執行網格打開缺陷窗口當「TC_STATUS」是「失敗」從Excecution電網新缺陷時,狀態變爲失敗

下面的代碼似乎只有當我執行工作「全」 跑

Actions.Action("Defects.NewDefect").Execute 

Actions.Action("StepsView.NewDefect").Execute 

我已經嘗試過:

Actions.Action("TestSetView.NewDefect").Execute  

但這無助

回答

0

您可以發佈新的缺陷每次自動測試實例狀態發生改變並把這個新的缺陷,以目前選定的測試實例。

在測試實驗室模塊腳本流程把這個代碼:

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 
相關問題