Forum Discussion

krishnadasari61's avatar
krishnadasari61
New Contributor
5 years ago
Solved

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 operation, I need to perform or validate from the servicev side only. for that, I need to use Groovy script which doesn`t support the writing of more classes like in other tools. Please guide me.

  • 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.

     

1 Reply

  • 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.