Monday, January 9, 2023
HomeSoftware TestingWhich Testing Instruments Are The Finest for API Check Automation?

Which Testing Instruments Are The Finest for API Check Automation?


Head to any web site through which testers and builders are searching for assistance on their testing, and also you’ll see questions on which instruments people ought to undertake, study and use. For instance, I not too long ago learn a query from one one that wished to know whether or not they need to study Postman or RestAssured for API automation.

Writer: Mark Winteringham

On the floor, this looks like a query that may be simply answered, which was demonstrated in a number of the responses to the unique poster’s query. Every individual replying shared their very own experiences and what they felt was their most well-liked software. That is useful to grasp the preferences of others however it doesn’t reply the query: What software do it’s worthwhile to study?

What are you hoping to realize?

As an alternative of specializing in what instruments can and can’t obtain, whether or not it’s for API automation or different conditions, we should always analyse why we want particular instruments for API automation. The problem now we have relating to software choice is avoiding the legislation of devices entice:

“If all you’ve gotten is a hammer then all the things seems to be like a nail”

That means that if we ignore why we want tooling within the first place and simply go for the most well-liked instruments. We danger deciding on instruments that at finest aren’t the precise match for us and at worst will actively disrupt our work and waste our time.

To exhibit what I imply; when somebody says to me that they want a software for “API Testing” my first response can be: what kind of testing do you imply? Testing comprises a variety of actions: exploratory testing, automating smoke checks, contract testing, efficiency, and the record goes on. Totally different instruments are going to assist with completely different actions. Going again to the sooner query requested on Reddit “Ought to I exploit Postman or RestAssured?” If we have a look at what every software affords when it comes to options we’ll observe that they’re comparatively comparable. They permit us to ship HTTP requests and assert the responses to find out if one thing meets our expectations or doesn’t. Postman has a properly introduced UI, RestAssured has a neatly organized API. Totally different implementations, however the identical performance at its core. So it’s onerous to make a comparability based mostly on their options. As an alternative, let’s take into consideration what we wish to obtain with our instruments.

When I’m doing exploratory testing, I like to make use of Postman. It’s straightforward to import requests, there’s a historical past characteristic to leverage and I can rapidly create API requests to experiment with an API. It’s additionally very easy to create data-driven API requests within the runner software that permit me to ship a whole bunch of requests to then analyse to see if any errors seem or tendencies reveal themselves. I can do all this in RestAssured, when I’m exploratory testing, however this isn’t essentially the very best use of my time. If I’m battling CSV imports in Java, my consideration isn’t on the testing at hand, which impacts the standard of my testing.

Equally, I discover when I’m constructing automation, I choose instruments like RestAssured over Postman. I like that I’ve management over how I construct my automated API checks. I can implement mocks simply, create customized reviews and cleanly organize my code. I can also embed my automation codebase with the manufacturing code (Assuming the codebase is in Java). This encourages group possession of automation and helps everybody to leverage API automation.

To be clear, these are simply examples based mostly by myself experiences in testing and never particular solutions to what you need to and shouldn’t use. I discovered that these instruments labored for me in numerous methods for various actions by listening to what I wished to realize after which evaluating instruments that suited my wants on a case by case foundation.

What’s your context

As I discussed, my examples of choosing instruments for particular testing actions are usually not particular solutions on which instruments to make use of and when. That’s as a result of though my examples would possibly share some similarities with what others may be doing of their testing, the context through which these actions are being carried out may be completely different. To exhibit what I imply by how context can affect our decision-making, let’s take three completely different examples:

  • Manufacturing structure – The language and libraries you utilize will affect what instruments you would possibly wish to use. In case your APIs are inbuilt Java, then maybe RestAssured is a superb selection. You may simply mix automation and manufacturing code into one challenge. But when your APIs are constructed utilizing Python then utilizing RestAssured means a number of languages and tasks to assist. Which may very well be an pointless overhead.
  • Crew expertise – If we would like groups to undertake particular software units then appreciating everyone’s ability units and preferences is a should. It could be that Software A is the simplest software for the job, in comparison with Software B that everybody makes use of. However in case you have restricted time and finances to coach individuals earlier than the challenge is concluded then it may be that the restricted options of Software B are an appropriate trade-off and sufficient to get you over the end line.
  • Tradition – Lastly, think about you’ve gotten determined you wish to use the brand new SuperWicked API Testing software Professional. What good is that if you happen to can’t set up it as a result of IT insurance policies have locked down your machines? Administration is being suggested to make use of completely different instruments by one other group or exterior gross sales group. Testing is seen as pointless! The tradition of your organisation will restrict or improve the alternatives you wish to make. Simply since you used that useful gizmo in a earlier function doesn’t imply it’s going to work in your new context.

What these examples exhibit is a necessity to grasp your context and the way it impacts your skill check or ‘Testability’. Understanding what’s going on in our tasks and organisations will assist us to understand what decisions we will and might’t make.

Get skilled

What I’ve hopefully demonstrated is that there isn’t any proper or unsuitable API testing software to decide on (This will after all be utilized to all software choices). So if there isn’t any single software to get good with then you definately’re free to study any software you want.

My colleague, Richard Bradshaw, and I like to speak about being ‘Software conscious’. This implies taking the time to study a number of completely different instruments which can be obtainable to you. So go check out Postman, RestAssured, Curl or the multitude of different API instruments on the market. What you’ll discover is you’ll construct up a library of data about these instruments, what they will do, what they will’t and what they may help with. The result’s that if you happen to mix your rising data of instruments together with your evaluation of what you need a software that will help you with and the way it will match finest into your context. You’ll have the ability to rapidly establish the precise software for the job.

Conclusion

The selection of API automation instruments and instruments for testing/automation, usually, is staggering. There was an explosion of them prior to now few years and many individuals have many opinions on what is correct and what’s unsuitable. However ultimately, they aren’t you and so they aren’t engaged on the identical challenges as you and your group. What’s the finest software for API automation? The one which you understand will allow you to obtain what you wish to obtain in a manner that matches your context.

Concerning the Writer

Mark Winteringham is a global speaker and teacher in Software program Testing. Drawing on over 10 years of testing experience engaged on award-winning tasks throughout a variety of know-how sectors and purchasers together with BBC, Barclays, UK Authorities and Thomson Reuters. Mark has helped groups internationally to ship fashionable risk-based testing methods by his coaching in API Testing, Automation in Testing, Behaviour Pushed Growth and Exploratory testing methods. He’s the co-founder of Ministry of Testing Necessities, a web based group elevating consciousness of careers in testing and bettering testing schooling. He additionally co-created the Automation in Testing namespace which affords a contemporary method to check automation practices.

Mark Winteringham is the creator of the e book Testing Net APIs printed by Manning. Software program Testing Journal readers can purchase the e book and all different Manning publications with a 35% low cost utilizing the code blsofttm23.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments