
Writing API Tests with Karate
By :

If you remember, in Chapter 6, More Advanced Karate Features, we had an example of authenticating an API using an authentication token. Now, imagine—for example—having a real login to a website performed in Karate UI and then reusing the authentication token in Karate API requests. In another example, you could get the order number for a certain product from a store API using Karate API requests and then automatically enter it into the search mask on a website to further test the UI with this exact product.
Here, it becomes clear how powerful the combination of these two Karate test modules is. However, the whole situation becomes even more powerful when we use the mocking capabilities that we already learned about in Chapter 7, Customizing and Optimizing Karate Tests!
Chrome only
This mocking capability is only available in Chrome when using the Karate Chrome driver (the ChromeDriver driver will not work since it uses the WebDriver protocol...