krogold
6 years agoRegular Contributor
Is it possible to get a 'call stack' in readyAPI ?
Hello,
I use generic test cases as common methods for my other test cases. When one of them fail, I can get some information, but mainly I get a generic error return with no detail of what happened in the sub functions.
Is there a possibility to get a kind of call stack that would give me the latest test cases I've been through ?
thank you
Alex
I too use a set of "common" test cases for reusable functionality. While not a "call stack", I put the following code into my common library test case tear down scripts:
def logPrefix = testCase.getName() + ': ' for(result in testRunner.getResults()){ if(result.getStatus().toString() != 'PASS' ){ def failedTestStepName = result.getTestStep().getName() def logPrefixStep = logPrefix.trim() + failedTestStepName + ': ' log.error(logPrefixStep + 'TestStep "' + failedTestStepName + '" finished with the status ' + result.getStatus().toString()) for(testProperty in testCase.getTestStepByName(failedTestStepName).getPropertyList()){ if(testProperty.isReadOnly()){ log.info(logPrefixStep + 'Output property: ' + testProperty.getName() + ' = ' + testProperty.getValue()) }else{ log.info(logPrefixStep + 'Input property: ' + testProperty.getName() + ' = ' + testProperty.getValue()) } } for(message in result.getMessages()){ log.error(logPrefixStep + 'Error message: ' + message) } } }
This usually provides me with the information I require to debug.