Ask a Question

Call a groovy assertion script form an external file

OOTesting
Occasional Contributor

Call a groovy assertion script form an external file

I'm new to readyAPI and would like to know if it is possible to call a groovy script as a external file that can then be used by all test cases?

 

My soap based response include a success response code that is in all responses, I want to verify that response code is included in every response.

 

Rather than adding the script to every request, can we specify a single external file to be called instead?

3 REPLIES 3
JHunt
Community Hero

Re: Call a groovy assertion script form an external file

Since you mentioned ReadyAPI, I have moved this to the SoapUI Pro forum. ReadyAPI might have some nifty tricks to help with what you're doing here (but I've never used it). If I've made a mistake and you're using SoapUI Open Source, let me know and I'll move it back and offer some suggestions.
OOTesting
Occasional Contributor

Re: Call a groovy assertion script form an external file

Hi,

Although using readyAPI, I prefer to have a solution that can be utilised for SOAPUI (open source) as well.

Radford
Super Contributor

Re: Call a groovy assertion script form an external file

You can specify a directory to store common groovy scripts, see the documentatiuon here for details of how to specify the directory and how to structure your Groovy files:

 

https://support.smartbear.com/readyapi/docs/testing/scripts/library.html

 

Note: The above documantation shows you how to set a global scripts directory, should you wish to specify a "per project" scripts directory, see documantation here:

 

https://support.smartbear.com/readyapi/docs/projects/ui/projects/properties.html

cancel
Showing results for 
Search instead for 
Did you mean: