Forum Discussion

HaroldR's avatar
HaroldR
Contributor
7 years ago
Solved

Re: testRunner/Context Object in groovy script

Hey,  I would like understanding how to use testRunner in differents cases : 1)Inside Setup Script at at Project level 2)Inside Setup Script at at TestSuite level 3)Inside Setup Script at at Te...
  • nmrao's avatar
    7 years ago
    Requesting to have a look at the right top of the script editor (for the mentioned cases) including Groovy Script test step. That shows the initialized variable names available for the user to use in the respective level.

    You may notice that `testRunner` is only available for Groovy Script and there are different objects for the other cases.

    However, 'context' is available in all the cases.

    Hope this clarifies
  • HaroldR's avatar
    HaroldR
    7 years ago

    nmrao wrote:
    Requesting to have a look at the right top of the script editor 

    Thaks for the reply nmrao,
    That's the solution. Finally, you just have to take a look to all variables mentioned at the top right of every script. At first glance, I did not notice that there were differents from a window to another.

    Also, I asked this question in another forum and the person who gave me the explaination did it very well, here it is :

    1) At project level - you will find either 'Setup script' and 'TearDown script', where you can use project variable (which is an instance of com.eviware.soapui.impl.wsdl.WsdlProject). Remember it is not equivalent to testRunner.

    2) At testsuite level - you will find 'Setup script' and 'TearDown script', where you can use runner variable. This is equivalent to testRunner, but it is an instance of com.eviware.soapui.impl.wsdl.panels.support.MockTestSuiteRunner
    3) At testcase level - you will also find 'setup script' and 'teardown script', where you can use testRunner variable which is an instance of com.eviware.soapui.impl.wsdl.panels.support.MockTestRunner