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?

4 Likes

Hi @ms.salona

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

Warm Regards,

5 Likes

Ow yea, you will love it @ms.salona

I made a racket about it: How to hunt for Bugs on the API: API Testing - How I hunt for bugs | Racket
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

5 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.

3 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!!

4 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:

3 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

3 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.

2 Likes