I was looking for some help with automating a process that maps requirements to all tests in QC using QTP.
So far, I have been successful in gathering all requirements using (RTM ID), and storing it in an array (using ReqFactory). Based on those those IDs, I want to map them to the tests. In all tests, there's a customized field (TS_USER_02) that has the RTM ID stored, I'm also successful in storing TS_USER_02 in another array (using DesignStepFactory, TreeMgr, and TestFactory). I just don't understand how to finally map requirements that I gathered to the tests in Test Plan module using those two arrays that I have created. Is there a function I can use that does this?
Re: Automate Process To Map Requirements using QTP
I looked into "CoverRequirement Method" and "HasCoverage Property" in the OTA documentation, and I still do not understand how to map the requirements to the test. The following is my pseudocode that I came up with:
'Navigate to Test Plan
Set TreeMgr = QCConnection.TreeManager
Set Tree = TreeMgr.NodeByPath(sNode) 'where sNode = Location 'of Tests
'Navigate to Test
strSearch = "<Req ID>"
Set ReqFactory = QCConnection.ReqFactory
Set oFilter = ReqFactory.Filter()
oFilter.Filter("<Req Field Name>") = strSearch
Set ReqList = ReqFactory.NewList(oReqFilter.Text)
If ReqList.Count > 0 Then
CoverRequirement ReqList.Item(1), TDPOSITON_LAST, "TRUE"
The code is working till CoverRequirement, I don't understand how to use it. Please help.