HOW TO TEST RESTFUL WEB SERVICES IN SOAPUI
What is RESTFul Web Services? Why is it Needed:
REST (Representational State of Transfer) is a lightweight option for developing web services the uses the HTTP protocol –a fact that makes is simpler with less overhead than a web service that uses the SOAP protocol.
It is an architecture style for for creating network based applications. REST uses various representations to represent a resource like Text, XML and JSON. JSON is now the most popular format being used in Web Services.
Tools For Testing RESTFul Web Services
1.Advanced Rest Client (ARC)
2.SoapUI
3.Postman-Rest Client
There are mainly 4 methods involve in SOAPUI Testing like Get, POST, Delete, and PUT.
1.GET- The GET method is used to extract information from the given server using a given URI.While using GET request , it should only extract data and should have no other effect on the data.
2.POST- A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms.
3.PUT- Replaces all current representations of the target resource with the uploaded content.
4.DELETE- Removes all current representations of the target resource given by a URI.
5.OPTIONS − Used to get the supported operations on a resource.
NOTE:For Testing RESTful WebServces in ARC Click here
Steps for Testing RESTful Web Services using SoapUI tool.
For this example, I'll be using the
Example: http://localhost:8990/MouriApp/Config read
http://172.16.40.169:8990/Mouri_App/Config_read
For this example, I'll be using the
Example: http://localhost:8990/MouriApp/Config read
http://172.16.40.169:8990/Mouri_App/Config_read
Step 1: Before opening the SoapUI IDE, make sure your RESTful web service project is properly deployed on tomcat web server. To check the web service project is working smoothly, So i am chossing to test json data response, My Project Deployed link is http://172.16.40.169:8990/Mouri_App/Config_read
Step2: Now open the SOAPUI IDE ,
Step3: Create a new project. Follow the path: File >> New REST Project or just click anywhere in soapUI tool and use ‘Ctrl+Alt-N’ to create a new RESTproject.
Step4: After clicking New REST Project it will shows pop-up which looks like as shown in below.
Step4: After clicking New REST Project it will shows pop-up which looks like as shown in below.
Step5: Give the proper URl, here i am giving http://172.16.40.169:8990/Mouri_App/Config_read, you can also deploye your project http url .
Step5: Give the proper URl, here i am giving http://172.16.40.169:8990/Mouri_App/Config_read, you can also deploye your project http url .
Step 7: there is so many methods displayed here, select the required method.
Step 8: Then Submit the Request to specified end point URl i.e Click on run button then The JSON Data Will be Displayed left side.
Step 9: Now, how to test the web services in soapUI tool!
Within the project, Testers can create a test suite by performing a right click on the project, and select New TestSuite.
Step 7: there is so many methods displayed here, select the required method.
Step 8: Then Submit the Request to specified end point URl i.e Click on run button then The JSON Data Will be Displayed left side.
Step 9: Now, how to test the web services in soapUI tool!
Within the project, Testers can create a test suite by performing a right click on the project, and select New TestSuite.
Step 10:After click on Generate TestSuite, the Page will shows
Step 11:Enter the name of the test suite or By Default it gives TestSuite1 but i here i am changing to RESTful web services testing and press OK.
Step 13: double click on Request 1 then Right side popup will appeared then click on run button and click on JSON ,
Step 14: Then
the JSON Data will appeared like
If you want to test more, please refer Assertions Topic in the SOAP Webservices.
For Testing SOAP Webservice In SOAPUI Click here
Thanks & Regards,
Brahma Reddy chagani,
Technical Trainee,
MOURI Tech PVT LTD.
http://www.mouritech.com/
Thanks & Regards,
Brahma Reddy chagani,
Technical Trainee,
MOURI Tech PVT LTD.
http://www.mouritech.com/
Comments
Post a Comment