Swathika provides valuable insights on how adding API interception to your UI tests can simulate edge cases, manipulate application behaviour, and enable more comprehensive test coverage. This helps you write more robust tests and have much more control over the testing process.
After reading the article, why not share your favourite API interception strategies? Whether it’s specific techniques you’ve found effective, unique use cases you’ve tackled, or creative ways you’ve integrated API interception into your workflow, we’d love to hear your experiences! Or perhaps you’re just getting started, do you think you will adopt API interception in your UI automation tests?
I haven’t had experience using request/response interception in automation, and frankly, I don’t remember any cases when it was necessary or particularly important for automation. As you mentioned, there are tools and approaches for testing APIs, UI, and 2e2 scenarios and usually, it works fine and simply. If you need a specific response, you can often test the app without interception, although I can imagine some infrastructural peculiarities where this may be required. However, I often intercept requests and proxy traffic in my testing tasks to inspect client-server communication and perform various tests, including security checks. I use Burp Suite for this - it has a user-friendly UI and offers numerous features that are great for interception, API, and feature testing, and security tests.
Hi, totally agree your points but this article will be more relevant for testers who already use Cypress for their test automation and would like to introduce API validations in their UI tests… I found it very beneficial and easy to adapt in my current setup
API: An application programming interface is a way for two or more computer programs or components to communicate with each other. It is a type of software interface, offering a service to other pieces of software.
I’ve used Web: BurpSuite, Charles, Fidler and Network: Wireshark
Interception technique/strategy:
Enable proxy, install a certificate, whitelist in Firewall, change IP address, route traffic through app, and catch requests/responses then modify.
Testing strategy: the modified requests/responses varied depending on what I wanted to discover.