Forum Discussion

przemyslaw_fryc's avatar
przemyslaw_fryc
Occasional Contributor
15 years ago

[soapUIPro 3.6]Commandline defined reportpath in test script

Hi,
Inside a test script (soapUI Pro 3.6) I would like use a variable which contains the declared report path. I mean a variable set by running test from commandline (by testrunner: -f"some path"). How I can do that (I'm sure it must be possible!)?
Greetings,
mz

7 Replies

  • Hi!

    this actually isn't available, but I've added a Soapui.cmdLineRunner property that is set when running from the command-line which give you access to the current runner; use its outputFolder property to get the report path. Coming the next nightly build.

    regards!

    /Ole
    eviware.com
  • przemyslaw_fryc's avatar
    przemyslaw_fryc
    Occasional Contributor
    Ok, I need some help yet. I've downloaded the last nightly build of soapUI and tried to use "outputFolder" property in the "Teardown script" section (testcase level) in many ways, but I failed. Can you provide some example of setting variable with this property?
  • Hi!

    sure.. try the following:

    import com.eviware.soapui.SoapUI

    // running from commandline?
    if( SoapUI.cmdLineRunner != null )
    {
    def outputFolder = SoapUI.cmdLineRunner.outputFolder
    ...
    }

    does that work ok?

    regards!

    /Ole
    eviware.com
  • przemyslaw_fryc's avatar
    przemyslaw_fryc
    Occasional Contributor
    I've tried this way before, but then the error occurs:
    groovy.lang.MissingPropertyException: No such property: cmdLineRunner for class: com.eviware.soapui.SoapUI

    Maybe I've downloaded the wrong version:
    Build soapui-pro-3.6.2-daily-2010-12-14-[2], Build Date 2010/12/14 02:29
    ?
  • Yes, sorry for the troubles.. we had an error in the build which resulted in it not being published.

    regards!

    /Ole
    eviware.com