In our previous article we looked at the ABC’s of how to be a test automation professional in the community. Having a good knowledge on Selenium and test automation…lets now continue our journey…without further continuing our journey on front end test automation lets look at web services testing..
Looking at the testing and test automation pyramid we see that we have to look at web services testing first than continuing on UI testing..
Web services or service level testing is much more important. Every solution starts with unit testing then moving into web services testing. If we test the services level first and we can capture more defects, rather than waiting for the UI to come up. More bugs captured at the services level helps us to reduce the pressure of testing and finding a bag full of defects at the end. If we emphasis on this practice we can really mitigate the risk of delivering defective software or even delay sending the ship into the sea.
We use Postman or SOAP UI to test web services manually. Postman is one of the popular testing tool which is free to use. The marvelous interface it gives helps the beginner of web services testing to carryout its task smoothly. Any person can test GET/POST/PUT or DELETE request manually.
Most organizations these days tend to automate web services testing to gain maximum returns. If a project is long term, has set of skilled technical test automation professionals, have a huge chunk of test cases…it is obvious to start automating them. Postman test suite which was done manually can be automated by Newman without any extra effort or cost.
If you’ll are knowing Java or have a good Java background we can start on web services test automation with Rest Assured. With Rest Assured we can automate GET/POST/DELETE/UPDATE web service request very easily. Look at how we can automate a simple Post request via Rest Assured.
For those who love to experiment Rest Assured, you can look at the sample code published at https://github.com/lkkushan101/RestAssured_Register/tree/master/eclipse-workspace-workshop/RestAssuredTestLogin
As a person to learn test automation with Rest Assured we have to experiment all the types of requests. Here are the sample code for performing PUT request with Rest Assured.
Hope this article gave a heads up to the community to start test automation of web services…In our next articles we will look at UniRest, Karate and Apache HTTP client which are on Java based test automation tools for web services.
Stay tuned for more awesome learning on test automation…