Player433
14 years agoNew Contributor
AssertionList Issue
I have a groovy script that basically goes through every test step in a test case and displays a report of all assertions of each test step.
I recently introduced database validations in a test case and becuase of the properties file and groovy scripts that were added, they are failing my groovy test step.
Ultimately the problem is that I have other test step types in my test case, but I don't know how to figure out what kind of test step I have.
If I knew of a command that could identify what type of test step I have, then this would be done.
Thanks
I recently introduced database validations in a test case and becuase of the properties file and groovy scripts that were added, they are failing my groovy test step.
def project = testRunner.testCase.testSuite.project
def testCase = testSuite.getTestCaseByName(project.getPropertyValue("TestCase"))
testCase.run(null, false)
for(testStep in testCase.getTestStepList()){
assertList = testStep.getAssertionList() <- testStep does not have method "getAssertionList()"
for(assertItem in assertList){
logSaver(testStep.getName() + " - Assertion :" + assertItem.getName() + "--" + assertItem.getStatus())
error = assertItem.getErrors()
if (error != null){logSaver(error[0].getMessage())}
}
}
Ultimately the problem is that I have other test step types in my test case, but I don't know how to figure out what kind of test step I have.
If I knew of a command that could identify what type of test step I have, then this would be done.
Thanks