Selenium automates browsers. It allows software developers to interact with web browsers in order to automatically test their applications. But can you use Selenium testing for API testing? Is Selenium API testing even possible?
Read on to learn:
- API testing
- Incorporating API testing with Selenium testing functional tests
- If Selenium is great for API Testing
APIs and Automated Testing
One question that came up during this year's Automation Guild session on Testing RESTful APIs with Rest-Assured with Bas Dijkstra was whether you can use Selenium for API testing.
This is actually a question that, surprisingly, I get asked all the time. But I liked Bas's answer in our TestTalks interview and during the Automation Guild Conference so much that I decided to share it with you.
How Do I Incorporate API Testing With My Selenium Testing Functional Tests
As I mentioned, whenever I talk about API testing, one question that probably comes to mind to most testers is, can I use Selenium for API testing, and if not, how do I incorporate API testing with my functional tests?
Bas pointed out that he actually wrote a blog post on this fairly recently on what Selenium is and what it is not. Because he also sees this question quite often, surprisingly often on media such as LinkedIn or specialized test automation forums and Twitter even.
For anybody who knows a little about Selenium webdriver that it's a … I'm not even calling it a test tool per se because it's a browser automation tool that simulates the interaction of a user with a browser. It does not simulate the interaction of a user of a system we make.
Selenium Is Not a Tool for API Testing
That should make it pretty clear that Selenium is not a tool for API testing.
Well, of course, if you have a user interface-based or custom framework which is built around the Selenium web browser, you could easily extend that framework to include API testing, but you need a different tool or library for doing that.
For More API Testing Awesomeness
For those of you that missed Bas and all the other awesome speakers at this year's Automation Guild Conference –no worries! Due to demand, I decided to keep registration open.
So you can still get all pre-recorded sessions and recorded Q&A now!