Forum Discussion

Aks1982's avatar
Aks1982
Occasional Contributor
11 years ago

Accessing setup and teardown scripts using groovy

Hi,

Is there a way to access testcase 'setup' and 'tear down' scripts from a groovy test step?

Regards,
Aks
  • Cizo89's avatar
    Cizo89
    Frequent Contributor
    Hi Aks,

    try following scripts:

    testRunner.testCase.getSetupScript()
    testRunner.testCase.getTearDownScript()

    testRunner.testCase.setSetupScript("setup script")
    testRunner.testCase.setTearDownScript("teardown script")


    Regards,
    Marek
    • HaroldR's avatar
      HaroldR
      Contributor

      Hello,

       

      Also, do you have any idea of how could I access a setup script which is placed at project level with testRunner object?

      Regards,

      Harold