Why the heck is not everyone using Karate for their automated API testing in 2019?
Reading time: 17 minutes
Save this to read later on this site:
What was API testing again?
I took an excerpt from Wikipedia (which has an fantastic section on Testing and Software development). I highlighted some parts ;)
API testing is a type of software testing that involves testing application programming interfaces (APIs) directly and as part of integration testing to determine if they meet expectations for functionality, reliability, performance, and security. Since APIs lack a GUI, API testing is performed at the message layer. API testing is now considered critical for automating testing because APIs now serve as the primary interface to application logic and because GUI tests are difficult to maintain with the short release cycles and frequent changes commonly used with Agile software development and DevOps.
API Testing is recognized as being more suitable for test automation and continuous testing (especially the automation used with Agile software development and DevOps) than GUI testing. Reasons cited include:
- System complexity: GUI tests can't sufficiently verify functional paths and back-end APIs/services associated with multi-tier architectures. APIs are considered the most stable interface to the system under test.
- Short release cycles with fast feedback loops: Agile and DevOps teams working with short iterations and fast feedback loops find that GUI tests require considerable rework to keep pace with frequent change. Tests at the API layer are less brittle and easier to maintain.
For these reasons, it is recommended that teams increase their level of API testing while decreasing their reliance on GUI testing. API testing is recommended for the vast majority of test automation efforts and as much edge testing as possible. GUI testing is then reserved for validating typical use cases at the system level, mobile testing, and usability testing.
What are existing API testing tools?
While doing some research for this blog I came across this recent blog by Alice Aldaine about Top 10 API Testing Tools (Details & Updates Done for You!) it's a good read if you want to know more about other API testing tools. Obviously Karate is mentioned on her blog as well. This blog post is will continue with Karate DSL.
What is Karate DSL?
Karate is new API testing kid on the block. I think they are around since 2017. However Karate is not getting enough attention for the splendid tool it is. So basically this is a shout-out in blog style.
- Karate is like Cucumber (Gherkin-style) so use the Cucumber-power (for example: tags and scenario-outline)
✅. No extra Java code needed. Karate vs Cucumber ✅. Only 1 layer of Karate-script (based on Gherkin). Karate vs Cucumber ✅. Karate vs Cucumber ✅. Karate's support for calling other
*.featurefiles allows you to use a JSON array as the data-source and you can use JSON or even CSV directly in a data-driven
✅. Karate runs even
Scenario-s in parallel, not just
Also check the official video from Karate DSL.
A part from their website:
Web-Services Testing Made
Comments or Questions?
Want to read more about Karate DSL or shall I make a little tutorial on how to start with Karate DSL and test a real API? Let me know in the comment section below this page.