Forum Discussion

Chitra's avatar
Chitra
New Contributor
9 years ago

Error while generating script log using tear down script

Hi, I am trying to generate script log using tear down script and I am getting the error "groovy.lang.missingpropertyexception no such property testrunner for class"  while executing the below code :

 

testRunner.testCase.testSuite.project.testSuites["Utilities"].testCases["Reporting"].testSteps["Groovy1"].run(testRunner, context);

 

I have also tried defining this but it didnt work

def r = testRunner.testCase.testSuite.project.testSuites["Utilities"].testCases["Reporting"].testSteps["Groovy1"].run(testRunner, context);

 

Please help

  • nmrao's avatar
    nmrao
    Champion Level 3
    Do you have a suite, case, step as Utilities, Reporting, Groovy1 respectively in the same project?
    • Chitra's avatar
      Chitra
      New Contributor

      Yes they are. I have cross checked.

    • Chitra's avatar
      Chitra
      New Contributor

      Lemme put it in another way..  I have a project ABC, which have 5 test suites, I am trying to write a tear down script at project level, calling some utilities from test suite "Utilities"  . So is this is the correct way of calling???

       

      testRunner.testCase.testSuite.project.testSuites["Utilities"].testCases["Reporting"].testSteps["Groovy1"].run(testRunner, context);

      • nmrao's avatar
        nmrao
        Champion Level 3
        I believe that there ain't exists any thing call teardown for project level. Would you mind showing a screen shot?