cancel
Showing results for 
Search instead for 
Did you mean: 

how to write groovy scripts in servicev or virtualservice

SOLVED
Highlighted
New Contributor

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

Re: how to write groovy scripts in servicev or virtualservice

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.

 

Natalie
Customer Care Team

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓

View solution in original post

1 REPLY 1
Moderator

Re: how to write groovy scripts in servicev or virtualservice

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.

 

Natalie
Customer Care Team

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓

View solution in original post