Forum Discussion

aihnatsiuk's avatar
aihnatsiuk
Occasional Contributor
2 years ago

No such property: testRunner error when try to execute script on the project level (TearDown Script)

Hi, 

I have a script to check and delete test data if it exists before running TCs. The script works correctly when I try to run it inside some TC. But the script returns the error when I run the same script in the TearDown on the level of the Functional tests: Fri Apr 28 09:06:25 EDT 2023: ERROR: An error occurred while executing the test step: No such property: testRunner for class: Script19

 

Script:

try {
def currentProject = testRunner.testCase.testSuite.project
currentProject.testSuites["Precondition"].testCases["DeleteTemplates"].testSteps["DeleteTemsirolimus"].run(testRunner,context)} catch (Throwable e) {
log.error("An error occurred while executing the test step: " + e.getMessage())
}