Service Virtualization

Expand all | Collapse all

how to write groovy code in JSR-223

Jump to Best Answer
  • 1.  how to write groovy code in JSR-223

    Posted 05-03-2017 06:31 AM

    Hi All,

    I am using the JSR-223 Step to write a script but the scripting language is groovy instead of BeanShell, can anyone Please suggest how to write it in groovy.

    I already tried the drop down option to choose the language but it's not working in JSR-223 Step, I am getting multiple errors.

    I have to keep it in BeanShell only then only its working and I have to write the code in BeanShell(which is not preferable in my scenario, I have a built in script in groovy just want to paste it in the step).

    Is there any way to do that.

     

    Thanks,

    Naval



  • 2.  Re: how to write groovy code in JSR-223
    Best Answer

    Posted 05-03-2017 02:05 PM

    By default JSR-223 Step support script language BeanShell having properties scope test properties. 

    Try one more time by selecting script language as groovy and copy propertiese into scope as “ Test and system properties”

     

    If above does not work , then try below things.

    • Use below link and test if your groovy script valid and working fine.

    https://groovyconsole.appspot.com/

    • You can also use Groovy Script step in SOAP UI to test to insure it work fine.

     

    Hoping this helpful.

    Thanks,

    Rajesh k Singh



  • 3.  Re: how to write groovy code in JSR-223

    Posted 05-04-2017 01:32 AM

    can you please explain the first step.

    I have already done the part as copy and paste the script in context area and selected my language as groovy but its not working.

    Its working fine in SOAPUI.

    is there any property value in lisa property that i have to change.



  • 4.  Re: how to write groovy code in JSR-223

    Posted 05-04-2017 02:56 AM

    Change copy properties into scope as “ Test and system properties”  from dropdown.  with this change it should work. If not then share what error you getting ? also if possible share the screenshot.