Automation Testing
Automation testing is where QA shifts from manually repeating checks to using code and tools to validate software quickly, consistently, and repeatedly.
1. What is Automation Testing?
Automation testing means:
Using scripts, frameworks, and tools to execute tests automatically and compare actual vs expected results.
Instead of manually:
Automation runs it automatically.
Benefits:
✓ Faster execution
✓ Repeatable
✓ Better regression coverage
✓ Reduced human error
✓ Supports CI/CD pipelines
✓ Faster release cycles
Not everything should be automated.
Good candidates:
- Regression tests
- Smoke tests
- API validation
- Stable functionality
- Data-driven scenarios
- Cross-browser validation
Poor candidates:
- Rapidly changing UI
- One-off tests
- Exploratory testing
- Usability testing
2. Automation Testing Pyramid
Common strategy:
Approximate split:
- Unit tests → 70%
- API tests → 20%
- UI automation → 10%
Reason:
UI tests:
- Slower
- Flaky
- Maintenance heavy
API tests:
3. Selenium
Selenium Official Site
Selenium is:
An open-source browser automation framework.
Supports:
- Chrome
- Edge
- Firefox
- Safari
Languages:
- Java
- C#
- Python
- JavaScript
- Ruby
Architecture:
Example Selenium flow:
Strengths:
✓ Mature ecosystem
✓ Large community
✓ Multiple languages
✓ Enterprise adoption
Weaknesses:
✗ Slower setup
✗ WebDriver dependency
✗ More flaky if poorly designed
Common framework structure:
Usually implemented with:
- Page Object Model (POM)
- TestNG / JUnit
- Maven / Gradle
- CI/CD integration
4. Playwright
Playwright Official Site
Playwright is newer and increasingly popular.
Created by engineers formerly involved with Selenium and browser tooling.
Supports:
Languages:
- TypeScript
- JavaScript
- Python
- Java
- .NET
Example:
Major advantages:
✓ Faster execution
✓ Built-in waiting
✓ Auto retries
✓ Better stability
✓ Parallel execution
✓ Network interception
✓ Mobile emulation
Playwright automatically waits:
Instead of:
Playwright waits intelligently.
Example:
Waits for:
Less flaky.
5. Cypress
Cypress Official Site
Cypress focuses heavily on frontend testing.
Supports:
Example:
Strengths:
✓ Easy setup
✓ Excellent developer experience
✓ Fast feedback
✓ Great debugging tools
✓ Automatic waiting
Limitations:
Historically:
✗ Multi-tab limitations
✗ Browser support constraints (improved significantly)
✗ Mostly JavaScript ecosystem
Very popular in React/Angular/Vue teams.
6. Selenium vs Playwright vs Cypress
| Feature |
Selenium |
Playwright |
Cypress |
| Browser support |
Excellent |
Excellent |
Good |
| Speed |
Medium |
Fast |
Fast |
| Setup complexity |
Higher |
Medium |
Easy |
| Auto wait |
Limited |
Excellent |
Excellent |
| Language support |
Many |
Many |
JS/TS mainly |
| Parallel execution |
Extra config |
Built-in |
Supported |
| Mobile emulation |
Limited |
Strong |
Moderate |
| Flakiness |
More risk |
Lower |
Lower |
| Enterprise maturity |
Very high |
Growing rapidly |
High |
Current industry trend:
Legacy enterprise:
→ Selenium
Modern engineering teams:
→ Playwright
Frontend-heavy teams:
→ Cypress
7. API Automation Testing
UI tests validate:
"Can user click buttons?"
API tests validate:
"Does backend behave correctly?"
API automation is often higher value.
Example endpoint:
Request:
Expected response:
Validate:
- Status code
- Response body
- Headers
- Schema
- Response time
- Error handling
8. API Automation Tools
Postman
Postman Official Site
Example checks:
Validate:
✓ Response time
✓ Body values
✓ Headers
✓ Auth
REST Assured (Java)
REST Assured Official Site
Example:
Very common enterprise API framework.
Playwright API Testing
Playwright also supports APIs:
Single framework:
UI + API.
9. CI/CD Integration
Automation becomes powerful when integrated into pipelines.
Example pipeline:
Common tools:
- Jenkins
- GitHub Actions
- Azure DevOps
- GitLab CI
10. Automation Framework Design Principles
Good framework:
DRY
Don't Repeat Yourself
Bad:
Good:
Page Object Model (POM)
Structure:
UI selectors isolated.
Benefits:
✓ Easier maintenance
✓ Cleaner code
✓ Reduced duplication
Data Driven Testing
Example:
Single test:
Avoid duplicate scripts.
11. Flaky Tests (Big Automation Problem)
Flaky test:
Passes sometimes, fails sometimes.
Causes:
- Hard waits
- Timing issues
- Unstable environments
- Dynamic selectors
- Test data dependency
Bad:
Better:
Playwright reduces flakiness substantially.
12. Senior QA mindset for automation
Poor automation:
"Automate everything."
Strong automation strategy:
"Automate high-value, stable, repeatable tests and keep exploratory/manual testing where human insight matters."
Modern QA teams commonly aim for:
- API-heavy automation
- Lean UI automation
- Exploratory testing alongside automation
- CI/CD integration
- Accessibility automation where possible
Next logical topic for your QA + a11y path: Accessibility automation (axe-core, Lighthouse, Playwright accessibility testing, keyboard automation, WCAG validation).