In the previous blog How to start testing SoapUI 5.3.0 Sample Twitter API Project ,we successfully imported the Sample Twitter Project in SoapUI. Sample Twitter Project comes with one test case having four test steps.
Today we will add a simple groovy script step in the test case that will
- Modify property value "count" for the first test step "Search Request"
- Execute the first test step "Search Request" again from the script
- Access the json response of test step "Search request" and write it to a file
- Parse the json response to count number of tweets returned
Right click on Test Steps and select Groovy Script to add a new step. Now copy paste the below code and click the play button.
All groovy scripts are invoked with following three objects. Click on the links to view a complete list of methods that you can use with these objects to modify your script.
You can check the methods for these objects and play around with the groovy script above.
No comments:
Post a Comment