Prabaharan
5 years agoContributor
Importing JSON requests from local machine to soap ui in one short
Hi All,
I have crated a rest project in soapui for which I have aound 100 JSON request files in my local machine. Is there any script or way to copy all json requests from my local machine to soapui in one shot by creating individual test steps in soapui automatically instead of creating 100 test steps and then loading the requests manually?
Appreciate your help in advance.
Thanks
- Yes, it is definitely possible provided writing the code the for the same.
Alternative way I can think of is to create a test case and use data driven script (again groovy script, refer
https://community.smartbear.com/t5/SoapUI-Open-Source/Data-Driven-Testing-in-Soapui-Free-version/td-p/125076)
Create a csv file, have the file names in order in which you want to send request.
Have REST Request test step following groovy script.
In the data driven groovy script (you may have to modify to your need)
1. Read csv file first row, use a custom property for keeping the row count
2. Read file, and set this content as REST Request payload. Below should given some idea how to do.
https://github.com/nmrao/soapUIGroovyScripts/blob/85e6112abadb014cdb2d12ed3fb289cb2eea90af/groovy/json/UpdateNextJsonRequestFromCurrentResponse.groovy