Forum Discussion
Nastya_Khovrina
Alumni
9 years agoHi Nick,
According to Class WsdlProjectRequirements a requirement should be added to WsdlProjectRequirements (not to WsdlProject). To get it, you need to use context.getTestCase().getTestSuite().getProject().getRequirements().
So, to add the requirement to a testCase, you can use the following script:
def project = context.getTestCase().getTestSuite().getProject();
def testCase = context.getTestCase()
def requirements = project.getRequirements()
requirements.addRequirement("ID", testCase)