Service Virtualization

Expand all | Collapse all

How take variable value in to a property (Execute step JSR-223)

Jump to Best Answer
  • 1.  How take variable value in to a property (Execute step JSR-223)

    Posted 09-13-2018 07:23 AM

    I have written the code in Execute Step JSR-223 and I have set one value into a variable.

     

    exchangeRate1=cells.next().getStringCellValue()

     

    Lets suppose i has some value "12.33", 

     

    How I can take this value into a property and use it in response message.



  • 2.  Re: How take variable value in to a property (Execute step JSR-223)
    Best Answer

    Posted 09-13-2018 07:58 AM

    After your line, add a line:

    testExec.setStateValue("myNewProperty", exchangeRate1);

     

    In your VSI, you can now replace a hard-coded value with {{myNewProperty}} and it'll use the previously-loaded value of your exchangeRate1



  • 3.  Re: How take variable value in to a property (Execute step JSR-223)

    Posted 09-13-2018 08:34 AM

    Thanks mate