Forum Discussion

Liberty_Informa's avatar
Liberty_Informa
Regular Contributor
12 years ago

[Resolved] ProjectPath in testSuite teardown

Hi

Normally we write following in the groovy script to get project path

projectPath = testRunner.testCase.testSuite.project.getPropertyValue("projectPath")


What is an equivalent in the test suite's "tearDown script" where testrunner is not accessible?

Thanks.
  • Hi nrmao,

    In the Project's Setup Script, the project is passed in as a variable, so you can just do:

    project.getPropertyValue("projectPath")


    In the TestSuite's Setup Script, you get the project through the testSuite variable as shown before.

    Renato
    SmarBear Software
  • Hi,

    This is how you do it:
    projectPath = testSuite.project.getPropertyValue("projectPath")


    A tips is to have a look at the Script is invoked with... text in the upper-right corner of all script fields. If any of those variables are unknown to you, you can put a log.info variableName in the script to get the class name printed to the script log. Then you can search for the class name in the SoapUI API for information about what you can do with it.

    Regards

    Henrik O
    SmartBear Software
  • nmrao's avatar
    nmrao
    Icon for Champion Level 2 rankChampion Level 2
    @Henrik,
    The is the case with Setup Script / Load Script as well, correct?