0
Set TSChildren = TSFolder.FindChildren("")

For Each TSChild In TSChildren
    Set TSFactory = TSChild.testSetFactory
    Set TSList = TSFactory.NewList("")
    'Iterate through all the Test Sets
    For Each TestSet In TSList
    Set TSTestFactory = TestSet.TSTestFactory.NewList("")

    For Each TF In TSTestFactory

            k = k + 1
            Debug.Print "TC Count: " & k
         If TF.Status <> "No Run" Then

         Set runF = TF.RunFactory
         Set runFilter = runF.Filter
            runFilter.Clear

             runFilter("RN_EXECUTION_DATE") = ">= " & Date

         Set runList = runF.NewList(runFilter.Text)
          'filter by execution date
          'take nth run list
          iRunListCount = runList.Count
          totalRunCount = 0

            For Each RunItem In runList
                Set LnkFact = RunItem.BugLinkFactory
                LnkFact.FullLinkage = True 'for step links
                For Each Lnk In LnkFact.NewList("")
                    /*  Here my defects are not getting displayed*/
                   Set MyBug = Lnk.TargetEntity
                Next
            Next

        End If
    Next

Next

Next

Using above code I am not able to my get my linked defects for a test case.

Note : The reason is all defects were linked to a test instance, not to test run.

Nagama Inamdar
  • 2,851
  • 22
  • 39
  • 48
  • Are you searching for links associated with runs or test-instance? From the code, seems links added to run object will be returned, not with test instnace object. I don't have access to OTA api right now but I would suggest you to try TF.BugLinkFactory for initiating link factory if you would like to get defects associated with test-instance. – Gaurav Jan 18 '16 at 07:13

1 Answers1

0

Try this (in C#):

(TF as ILinkable).BugLinkFactory;
icalvo
  • 111
  • 1
  • 3
  • Hi, welcome to SO. Please don't just dump code, explain your thoughts to your fellow programmers. Cheers. – Cthulhu May 19 '16 at 15:21