How Do I access TestSet Entities in Run Modul?

Hi folks,

I try to customize the he Manual Run Dialog (New and MoveTo). I created some new Entites in Run and filled one with the status of the test case.

Now I want to get the "planed Testenvironment" either from the Testset or, when empty from the Test Cycle. (Both with New Entities filled from a List)

I tried to access the Testset entites like discribed in https://alm17-test.sha.vrkw.de:8443/qcbin/Help/doc_library/online_help/Content/WF_Customization/wf_example_CopyFieldValOth.htm.

The following snippet is called in Template_Run_New

' Ermittlung des aktuellen Testsets zum aktuellen Run
    Dim tdc
    set tdc = TDConnection
    Dim TSFact 'As TestSetFactory
    Set TSFact = tdc.TestSetFactory
    Dim TstSet 'As TestSet
    Set TstSet = TSFact.Item(Run_Fields("RN_CYCLE_ID").Value)
      MsgBox "1: TstSet.Item Name: " & TstSet.Name
      tmpval = TstSet.Fields.Count
      MsgBox "2: TstSet.Fields.Count = " & tmpval

      tmpval2 = TstSet.Field("CY_CYCLE_ID").Value
      MsgBox  "3: Testset-ID = " & tmpval2

      tmpval3 = TstSet.Field("CY_ASSIGN_RCYC").Value
      MsgBox  "4: Target Cycle = " & tmpval3


'
'    For i = 0 To TSTst.Fields.Count - 1
'         Test_Fields.FieldByID(i).FieldName, False, False, 100, 0, False
'     Next


'Zugriff auf den Test im Testplan
     Set TSTestFact = TstSet.TSTestFactory
        Dim TSTst 'As TSTest
        Set TSTst =  TSTestFact.Item(Run_Fields("RN_TESTCYCL_ID").Value)
        MsgBox "5: Testname = " & TSTst.Name


Result:

1. MsgBox shows Testset Name

2. MsgBox No Value

3. MsgBox No Value

4. MsgBox No Value

5. MsgBox show Testcase Name

What do I miss?

Thanks for any hint

  • Verified Answer

    +1

    Got it with some help from @

    Solution:

       myZielZyklusID = Run_Fields.Field("RN_ASSIGN_RCYC").Value.NodeId               ' Nur eine Nummer
       
        Set tdc = TDConnection
        Set myTestZyklusFact = tdc.CycleFactory
    '   Alternative
    '   Set myZielZyklus = myTestZyklusFact.Item(TLFolder.TargetCycle.NodeId)         ' Wenn Ermittlung über Testfolder-Zielzyklus
        Set myZielZyklus = myTestZyklusFact.Item(myZielZyklusID)
        MyRunUmgebung = myZielZyklus.Field("RCYC_USER_TEMPLATE_01")
        
        If Not MyRunUmgebung = "" Then
            Run_Fields.Field("RN_USER_TEMPLATE_01").Value = MyRunUmgebung
        End If

    Hope that helps in the future