Thank you everyone who joined us for our webinar about Groovy scripting in SoapUI. Click here to download the example project files we used in the Webinar . Use this test step to execute Groovy or JavaScript code from your tests. You can only debug scripts in the SoapUI Groovy Script test step. You can only debug . All SoapUI Pro support resources in one place. Easy access to product documentation.

Author: Dokora Guzshura
Country: Solomon Islands
Language: English (Spanish)
Genre: Technology
Published (Last): 24 September 2018
Pages: 203
PDF File Size: 2.21 Mb
ePub File Size: 12.72 Mb
ISBN: 624-6-31473-816-7
Downloads: 28355
Price: Free* [*Free Regsitration Required]
Uploader: Mokora

A basic knowledge of API testing and groovy script is required. All the validation rules and the response fields changes with every request, which makes it difficult to build a script which can be used to test all the requests. Here is the sample code that will remove the assertion created in the scrit above.

From a test case, test suite or a project. To write a value to a property, use the setPropertyValue method. Complex looping or branching.

You can modify the created assertion by using assertion-specific methods. Once the modified arrays are ready, sequential matching will be performed and in case of failure the index at which it fails will be stored.

Groovy Script Test Step | Documentation

The testRunner scripting object has two methods to stop the current test run: To get a property value: A generalized groovy framework will be built which can be used to perform data validation of slapui given request with minimal code changes. When the test run reaches a breakpoint, it stops. Process to build the data input excel has been explained in Step 2.


A breakpoint is a location in your script where you want the script or test to pause during the execution. By using the gotoStepByName method of the testRunner object, you can command ReadyAPI to jump the test execution to the specified test step after the script has finished.

Groovy Script Test Step

Join The Discussion Cancel reply You must be logged in to post a comment. Step-by-step Step 1- Building Groovy Project Structure The framework will have following structure where one test suite will be created for a project. Once the execution is paused, ReadyAPI will open the line with the breakpoint so that you can check the state of the test, its output and its variables. Scripts allow you to implement complex behavior of your test.

As the Customer Identification number is set as custom properties as CIN, the same value will be used in the request. Unlike the ReadyAPI installation package, the binary package does not include the required Java files.

For more information on community content, please refer to our Terms of Use. ReadyAPI will create a new assertion with the specified name and default settings. There are two ways to fail the test run from your scripts: Click the left margin of a source code line.

Sample Groovy Code for Verification: Framework Run To run the framework, input excel will sceipt filled with the test data.


The framework makes use of test data provided in excel. ReadyAPI uses the tools. If you click while the debugger is disabled, you will be prompted to restart ReadyAPI to enable grooyv.

The framework can be reused with any request. For binary package installations only: Once the framework structure is ready then the input excel can be build, which will be specific to the type of request. OracleDriver Later form a connection string as: Get test case object To obtain the object which refers to the containing test case, use the following code snippet: Is this page helpful? If the Abort test if an error occurs option is enabled in TestCase Optionsthe test will stop.

For example, the following code snippet runs ten random requests before executing the remaining script: For instance, you can verify these property values with the Assertion test step, or check tutoial and change the execution flow with the Conditional GoTo test step.

SOAP UI Groovy Automation Framework To Test API Field Data Validation

No Code change is required. The response of the request will also be printed in the excel.

Consider the response of the request mentioned in Step 4 as below: