Forum Discussion

krishnadasari61's avatar
krishnadasari61
New Contributor
6 years ago

how to write groovy scripts in servicev or virtualservice

I want guidance on ServiceV / Virtual service after creating the mockserver in servicev, I need to write some scripts to validate incoming requests from the client using Groovy. Because of every oper...
  • NBorovykh's avatar
    6 years ago

    Hi krishnadasari61,

     

    To validate requests coming to your virt, you can use assertions as described here: https://support.smartbear.com/readyapi/docs/servicev/validating/assertions.html For custom validation scenarios, the Script Assertion can be used. You can find a sample validation script in the "Tips" section of the above article. 

     

    Within your script assertion, you can use some third-party Java libraries that you place to the <ReadyAPI>\bin\ext folder beforehand. If you want to deploy your configured virt to VirtServer you need to copy all those libraries to the <VirtServer>\bin\ext manually.