ALMINFO Trusted Contributor.
Trusted Contributor.
757 views

OTA code to pull the test cases to test lab from Test plan only with traceability

In my project, I need to pull the test cases from test plan to test lab,but the condition is that those test cases should have the complete traceability.

Without Traceability ,the test cases should not be pulled.

Please share the code.

Thanks in advacne

0 Likes
5 Replies
Micro Focus Expert
Micro Focus Expert

Re: OTA code to pull the test cases to test lab from Test plan only with traceability

The API provides the Trace object to determine if a Requirement is Traced To or Traced From another requirement.

In respect to Tests, Requirements can Cover Tests. Are you needing the Tests in the Test Plan which are "Covered" by a Req(s)?

Phil Trostel
0 Likes
ALMINFO Trusted Contributor.
Trusted Contributor.

Re: OTA code to pull the test cases to test lab from Test plan only with traceability

Thanks for the response.

Let say in a test Plan folder few TCs are mapped to the Requirement.

Now When try to pull all the TCs of that folder to Test Lab. Script should verify and pull only the Tests which has requirement mapping

0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: OTA code to pull the test cases to test lab from Test plan only with traceability

The TestSet_CanAddTests workflow function allows you do work with the Test case IDs that are to be added to the Test Set.

However, the standard behavior is to either accept all by returning True or to deny all by returning False. If you want to add only those tests that are associated with a Requirement, you would need to make the function always return False, but make a distinction in the selection and only add part of the tests using the OTA API from the function.

But I would prefer to deny all addition in case one of the selected tests is missing the req coverage, and put up a MsgBox that identifies the problematic test cases.

As an alternative, you might encourage users to only use addition to test sets via the Requirements Tree tab in Execution Grid. Also, you may use the cross filter "Tests with no requirement coverage" to verify that all your tests are covered.

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
0 Likes
Highlighted
ALMINFO Trusted Contributor.
Trusted Contributor.

Re: OTA code to pull the test cases to test lab from Test plan only with traceability

Thanks for the speedy response,

Actually I was looking for this logic only,is it possible to share the logic for either to accept all by returning True or to deny all by returning False.

Thanks in Advacne

 

0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: OTA code to pull the test cases to test lab from Test plan only with traceability

A simple example:

 For i = 0 To UBound(Tests)
  If TDConnection.TestFactory.Item(Tests(i)).HasCoverage = False Then
    MsgBox "At least one of the selected tests has no requirement coverage"
    TestSet_CanAddTests = False
    Exit Function
  End If
Next
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.