get property value of a test case's step when this test case is called from another test case
Hi Guys. I am new to SoapUI tool and trying to setup a framework from scratch. I am using SoapUI for an end to end testing rather than API response validation.
So, as part of framework, I have setup it in such a way:
Suite1:
> TC1
> TC2
Suite2:
> TC3
> TC4
Generic: (This suite contains generic reusable tests which can be called in Suite1&2)
> loginToApp
> createAccounts
> fetchAccountDetails
I am creating a new custom report to report the execution detail of each step in extent report. I have used the test suite teardown script option to create a custom file for now.
The issue is: when I am trying to fetch response and request properties of my callable methods, they always return as Null. So I am not able to write them in my custom file.
This is my script below:
runner.results.each{ testCaseRunner ->
log.info 'test case name:'+testCaseRunner.testCase.name
testcase_logger = testsuite_logger.createNode(testCaseRunner.testCase.name);
testCaseRunner.results.each{testStepRunner->
def testStep=testStepRunner.testStep
log.info 'Config'+testStep.config
log.info 'Type'+testStep.config.type
if(testStep.config.type.toString().equals('calltestcase'))
{
def callableTest=testStep.targetTestCase
def callableTestName=callableTest.name
log.info 'callable test name--'+callableTestName
callableTest.getTestStepList().each{callableTestStep->
log.info 'callable step name---'+callableTestStep.name
log.info 'callable step type---'+callableTestStep.config.type
for(testProperty in callableTest.getTestStepByName(callableTestStep.name).getPropertyList()){
if(testProperty.isReadOnly()){
log.info( 'Output property: ' + testProperty.getName() + ' = ' + testProperty.getValue())
}else{
log.info( 'Input property: ' + testProperty.getName() + ' = ' + testProperty.getValue())
}
}
I have printed all the properties but request and response are always null.
Can anyone guide me on how to fetch request and response from the callable test step's response when the callable testcase is part of another testsuite?