How do I start API automation test?

I started UI automation with selenium nearly 2 years back. And now I’m thinking to start API automation as well. Is it really helpful and necessary to do API automation? And what are the major things we automate in APIs? Any suggestions on starting this API automation journey?

5 Likes

Hi @ms.salona

Reading and learning can definitely take time, but what you learn is going to be yours. please see

Warm Regards,

6 Likes

Ow yea, you will love it @ms.salona

I made a racket about it: How to hunt for Bugs on the API: https://racket.com/kristof_vk/rbH7b
What to test on an API (happy & unhappy flows):

  • JSON Values
  • Headers
  • HTTP Codes
  • Response time
  • Cookies
  • Cache
  • Authorization
  • Authentication
  • IDORs
  • Race conditions
3 Likes

And, if you want to learn about the technologies and tools, the Test Automation University has got some great resources:

5 Likes

Thank you so much for the links. I’ll start reading them first. It really looks helpful. :blush:

1 Like

Thank you so much :blush:. I’ll check them and try to understand.

2 Likes

Yes i do need to understand the tools and technologies. This looks helpful. I’ll check them. Thank you somuch :blush:

1 Like

If you have any questions, let us know! :stuck_out_tongue:

1 Like

Great blog post here on this subject

6 Likes

Congrats on starting your journey, @ms.salona. :tada:

Is the following Ask Me Anything on your radar?

Testing Ask Me Anything - API Testing - Hilary Weaver-Robb

Hilary Weaver-Robb shares so much useful information! And this is the treasure trove of the Club post that supports the video. There is a whole tonne of stuff to explore.

Good luck on your adventures.

5 Likes

Will definitely check out. Thank you :blush:

1 Like

yes this can be helpful too. Thank you :blush:

1 Like

Yes, Automating APIs are really helpful and necessary because whatever you see on UI are mainly sent/responded to by API’s so you can find more bugs with the help of API testing at an early stage itself. If you’re automating API’s then you can put only 20% of effort into GUI/UI testing using selenium.
API testing involves testing the application directly and as part of integration testing to determine if they meet expectations for functionality, reliability, performance, and security. In API testing you mainly have to test API requests and check/validate their responses, status code, token, etc with the help of HTTP methods.
To start with API testing, first, you must have a basic understanding of APIs, HTTP methods, how API works, etc. Once you understand these then you can start doing API testing manually with POSTMAN or any other tools. Once you’re familiar with POSTMAN then you can choose your own programming language to automate APIs using rest assured.
If you know all these things then Automating APIs with Rest assured will be easy, you can find various videos or courses on youtube and udemy regarding API automation using Rest Assured. You will explore more on API testing on your own once you start using it in real-time projects.

Happy Testing!!

5 Likes

Hey, thank you for so much of information. I really appreciate this. And yes i have been doing API test manually through POSTMAN, nothing too vague though. I’ll consider everything you mentioned. Have a good day :blush:

4 Likes

This is an amazing question and timely for me. Things that you should automate in API tests would

  • Data Verification - Does the request return the correct data, is the data in the expected format
  • Required Fields - Does the request return the correct error code when missing field information that is required? Do requests missing required fields return an error at all?
  • Variable Types and Values - Do request that accept integers accept any other type, should it accept that alternative type? Do requests that accept strings allow special characters?
  • Performance - Do HTTP requests return data in an expected amount of time?
  • Destructive Testing - Can we get the software to fail in an unexpected way - Using things like large payloads, malformed data, and testing the API when the System is under heavy load

One interesting type testing that can be used at all levels of testing is Chaos Testing also known as monkey testing. It takes test cases and randomly switches the input data to see how the tests handle the unexpected condition or removes services, resources from the system to see how the system fails. It is more of an advanced topic but I enjoyed reading about it. Check out this article on LinkedIn that is a general introduction to the practice Building resilient APIs with chaos engineering

5 Likes

Thanks for these details. However monkey testing is a new term for me. I’ll definitely go through the link you shared. Much appreciated. :blush:

2 Likes

+1 this blog post, it is very detailed and allows you to do your own research as you read it.

3 Likes

API Integration testing is the future of Integration testing. Basically an Application Programming Interface, or API, is the interface that helps facilitate connectivity and communication between two or more software applications. So, API layer of any application is the channel that connects client to server. API Integration refers to the connectivity that helps business organizations to automate the processes and embed/share data between system and application. So, API Integration testing basically involves testing the programming interface directly, as well as running integration tests to determine the functionality, reliability and security of the application.
API automation testing should cover at least following testing methods:

Discovery testing: The test group should manually execute the set of calls documented in the API

Usability testing: This testing verifies whether the API is functional and user-friendly.

Security testing: This testing includes what type of authentication is required and whether sensitive data is encrypted over HTTP or both

Automated testing: API testing should culminate in the creation of a set of scripts or a tool that can be used to execute the API regularly

Documentation: The test team has to make sure that the documentation is adequate and provides enough information to interact with the API. Documentation should be a part of the final deliverable

4 Likes