3

Currently, I am using JMeter to automate APIs but I have been asked to form a framework that is quicker and convenient to use for everyone in the team and a framework that preferably involves reading Rest API requests/headers/payload/URL from an excel sheet so that everyone in the QA team just adds to it and get's rolling with minimal efforts.

I have no idea how to proceed with the aforementioned requests of creating REST API automation framework. Please suggest with step by step detailed instructions, Thanks!

4

REST-Assured is one good option.

I have used it with Java. It's a really good option and gives you the flexibility to do a lot when it comes to API testing.

Refer to the below link for further details related to using Rest-Assured.

using REST-Assured

  • Many thanks for writing in! Yes, I also read about REST-Assured and I have got started with it and automated few APIs as well thus far. Just need a few suggestions: - How do I do things at a framework level? - How do I handle the reporting part? - I have written all the payload in the code itself. Is that a good practice? If not then how do I read payload from any other resource like sheet etc? - Any other practices for ensuing a good REST-Assured testing framework? – Rohan Kalia Apr 12 '18 at 6:08
  • Hello Rohan, sorry am not getting time to work on your questions. But will reply by end of the day tomorrow. I have seen your questions. Cheers! – Aalok Apr 13 '18 at 3:56
  • @RohanKalia here's a comparison between REST-assured and Karate: docs.google.com/document/d/… - this answers all these questions (disclaimer: am dev of Karate) – Peter Thomas Apr 14 '18 at 9:28
  • Hello Rohan, Here are the answers to your questions. So, framework depends on the nature of APIs. It entirely depends on you on how you want to organize your testware. It largely depends what makes things easier for you. For reporting, you can use TestNG reports or extent reports. I am more inclined towards extent reports because of better presentation. Writing payloads in the code is not a good practice. You should keep your payloads at some common location and have some common program to read the payload data from the file. Keep the payload in excel file and read the payloads – Aalok Apr 14 '18 at 10:31
  • You can write a function in java to read from excel. This function can be a part of your framework. – Aalok Apr 14 '18 at 10:33
1

You can try postman. It allows for header manipulation and reading from data sources like excel. It can also send multiple types of payloads including JSON, XML and text. There is a shared team workspace which you can use to share collections amongst the team.

It's good up until you need to do data validation against a database.

1

Have a look at Karate, a REST testing framework on top of Cucumber.

0

You should try out postman for REST API Automation. It is having lots of ability. You can Import JSON files you can try out Collection runner for Automation you can you Test Scripts of Postman tool from right-hand side of postman for more details "https://blog.imaginea.com/api-automation-using-postman/" check this blog it will be helpful

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.