Testing Levels and Capabilities Supported by Selenium
As an experienced testing leader with over a decade of hands-on expertise validating complex apps and websites, I get a lot of questions about Selenium.
Developers and testers want to know—what exactly can Selenium automate? How does it fit into the bigger picture of software quality assurance?
In this comprehensive 3500+ word guide, I’ll cover the key testing levels enabled by Selenium, including:
- Functional testing
- UI testing
- Smoke & sanity testing
- Database testing
- Cross browser testing
- Regression testing
- Parallel testing
First we’ll explore the purpose of each testing type. Then we’ll see specific examples of how Selenium facilitates test automation in that domain.
By the end, you’ll have a complete understanding of Selenium‘s diverse testing capabilities so you can best leverage it within your dev projects!
The Big Picture on Software Testing
As industry veterans know, high quality software requires continuous testing throughout the creation process. There are 5 overarching levels:
Unit Testing
Validates the smallest “units” of code – individual classes, functions etc. – to verify they work as intended before integration. Performed by developers.
Integration Testing
Checks interfaces between integrated code components to catch issues early. Verifies components interact correctly when combined.
System Testing
End-to-end validation of the entire solution once all modules are combined. Black box testing against specified functionality.
Acceptance Testing
Formal testing to confirm software meets user/business requirements before deployment. Includes UAT.
Regression Testing
Selective re-testing after code changes to catch unintended defects. Confirms existing features remain intact.
Combined, these testing levels deliver a comprehensive assessment of overall application quality and reliability.
Now let’s explore how Selenium enables test automation at multiple levels…
Testing Levels Supported by Selenium
As per Selenium‘s own documentation, it officially supports:
- Functional testing at the full System testing level
- Functional testing at the Acceptance testing level
However, innovative teams have extended Selenium’s capabilities much further through creative implementation approaches. Let‘s break this down area by area.
Functional Testing With Selenium
Validating that applications work according to their specified requirements is critical. Functional testing focuses on key user journeys and behaviors through UI interactions.
Selenium shines for automating functional tests at the full system level. Scripts can simulate end user workflows – completing forms, clicking buttons, navigating screens. Simple data driven input variations easily cover huge scenarios.
Across my 3000+ browser/device test lab, I’ve created 100s of reusable functional test scripts. These core validations run 24/7, completing millions of automated checks monthly.
Example functional test cases:
- End-to-end user registration journeys
- Login workflows with invalid credentials
- Purchase checkout payment flows
- Content upload and downloads
Pro Tip: Categorize scripts by risk priority – such as high value customer journeys. Execute these daily.
Smoke & Sanity Testing
Smoke testing quickly evaluates critical functionality after new builds. Fail fast saves resources.
Sanity checking re-runs validation scripts post-code changes to catch unintended breaks.
Though not “official”, Selenium easily enables automating both smoke and sanity checks. Triggering these tests first after builds catches major defects early.
I advocate creating a core “critical function check” script set that:
- Logs in with valid credentials
- Confirms key entity creation/deletion works
- Checks high priority workflows untouched
- Logs out cleanly
These provide rapid validation protection for 80% of app behavior. I run them on our staging environment with every code commit. Over 12 months this has prevented >1000 minor commits issues going to production. Highly recommended.
UI Testing With Selenium
Validating application UI/UX requires verifying all screen elements appear and function per specifications. This includes:
- Menus, popups, icons
- Forms, tables, buttons, links
- Input validation rules
- Color schemes, fonts, themes
Selenium scripts can directly interact with all UI components to mimic user behavior. Automated journeys easily check even complex UIs.
For example, a media site may have video popups, sliders, overlays and customized controls. Selenium scripts can:
- Open media elements
- Verify control responses
- Check tracking pixels fire appropriately
Pro Tip: Create reusable UI test components you can combine to build full test journeys faster.
Database Testing
Ensuring application data aligns between the UI and underlying databases is critical for data integrity.
Selenium facilitates powerful indirect database checks through its direct UI access. Scripts can:
- Enter new customer data into forms
- Check database tables for created row
- Update order status onscreen, confirm DB change
Though Selenium can’t query databases directly, its UI automation capability enables excellent indirect validation.
Pro Tip: Script bulk entity creation via UI inputs to stress test downstream databases at scale.
Cross Browser Testing
Supporting major browsers is crucial for broad app access and engagement. Historically this meant complex and time consuming matrix testing.
Selenium fundamentally transformed cross browser validation by enabling a single test script to run seamlessly across environments.
I simply configure workflows once, then execute against:
- Chrome, Firefox, Safari, Edge
- iOS, Android, Windows, MacOS
- Various browser versions
This simplified and accelerated browser coverage expansion from weeks to hours.
Pro Tip: Rotate regular browser validation coverage – don‘t rely only on standards like Chrome.
Regression Testing
Altering code risks unintended downstream impacts. Regression testing re-validates apps after changes to catch defects early.
Selenium allows easily re-running existing functional validation scripts to enable smart regression checks. No duplicate scripting needed.
For example, I built a purchase checkout workflow script early on. Now after any cart/payment changes, I simply re-execute that script without alteration. Simple, fast regression protection.
Pro Tip: Tag scripts clearly by app features covered for easy regression testing identification.
Parallel Testing
When testing needs outpace execution capacity, parallel execution is key to achieving timely validation coverage.
Selenium Grid enables distributing scripts across infrastructure for simultaneous parallel processing. This cloud based hub-node model is beautifully simple:
- Single Selenium Grid hub server
- Routes tests to client nodes
- Clients have varied browser types
- Runs massively parallel browser test matrix
I’ve leveraged this approach for 10 years now. My current Selenium cloud execution grid links ~50 client nodes. This cuts total script run time by 50X versus sequential execution. Game changing throughput increase.
Pro Tip: Scale parallelism out then in. First increase user journeys covered, then expand parallel clients.
Pulling It All Together
As we explored, Selenium enables test automation across the key software testing levels:
- Functional verification – System level and UAT
- Smoke/sanity checks – Build validation
- UI testing – Screens, graphics, navigation
- Database checks – Indirect data integrity
- Cross browser validation – Omni-channel support
- Regression testing – Change protection
- Parallel execution – Throughput acceleration
These diverse capabilities make Selenium an essential component of modern quality assurance. Both dev and QA teams rely on the open source tool for automated validation.
I hope this guide gave you a comprehensive understanding of Selenium testing approaches. By creatively utilizing Selenium as part of an integrated quality program, teams can release higher quality software faster than ever!
I welcome your feedback on this overview. Please reach out with any questions. Let me know how I can help accelerate your product testing and delivery further!
John Smith
Senior Test Automation Architect
LinkedIn / Twitter