Creating a New Framework from Scratch
Interview Answer
"If I get a chance to create a new automation framework from scratch, I'll follow a systematic approach."
Step 1: Requirement Analysis
Understand:
- Application Type (Web, Mobile, API)
- Technology Stack
- Testing Scope
Based on these factors, decide the appropriate framework type, such as:
The framework should always suit the project requirements rather than being copied from another project.
Step 2: Tool Selection
Choose the required tools.
Example:
Each tool serves a specific purpose:
- Selenium → UI Automation
- Java → Programming Language
- TestNG → Test Execution & Management
- Maven → Dependency & Build Management
- Extent Reports → HTML Reporting
- Jenkins → CI/CD
Step 3: Maven Project Structure
Create a proper project structure.
Typical packages include:
basepagestestsutilitiesdataconfig
The framework development process follows:
Requirement Analysis → Tool Selection → Project Structure
Types of Tests Performed
The project included multiple types of testing.
Functional Testing
Validates that the application works according to business requirements.
Examples:
- Valid Login
- Invalid Login
- Error Message Validation
- Button Validation
- Link Validation
Regression Testing
Ensures new code changes do not affect existing functionality.
Examples:
- Login
- Logout
- Navigation
- Previously tested features
Additional Testing
Also performed:
- Smoke Testing
- Sanity Testing
- Integration Testing
- UI Testing
- Database Testing
- API Testing
How Many Test Cases You Automated
Interview Answer
"I automated around XX–YY test cases, covering key functionalities such as login, navigation, form submissions, validations, and end-to-end workflows. The test cases were prioritized based on critical business scenarios, frequently used functionalities, and regression requirements."
The automation suite included:
Functional Test Cases
Examples:
- Login
- Registration
- Dashboard
- User Management
Regression Test Cases
Included:
- Smoke Suite
- Regression Suite
- Sanity Suite
Executed on every build.
Data-Driven Test Cases
The same test cases were executed using multiple datasets.
Note: Replace XX–YY with your actual project numbers (for example, 200–250+ automated regression test cases).
What Percentage of the Application Is Automated?
Interview Answer
"In our Selenium Hybrid Framework, approximately 70–80% of the test cases are automated."
The automated portion includes:
- Regression Testing
- Smoke Testing
- Data-Driven Testing
- Cross-Browser Testing
- End-to-End Testing
Examples:
- Login
- Form Submission
- Transactions
Manual Testing
Approximately 20–30% of testing remains manual.
Examples include:
- Complex UI Validation
- Exploratory Testing
- One-time Scenarios
These scenarios are generally not cost-effective to automate.
Handling CAPTCHA
CAPTCHA is designed to prevent automated bots.
It is generally not recommended to automate CAPTCHA directly.
Why CAPTCHA Should Not Be Automated
- Security Risk
- Dynamic and Unreliable
- Designed to Prevent Automation
Recommended Approach
- Disable CAPTCHA in the Test Environment.
- Use a Test or Bypass Key provided by the Development Team.
- Handle CAPTCHA manually when required.
Avoid attempting to solve CAPTCHA images through automation.
How You Tested Your Project
Interview Answer
"I tested my project using manual and automation testing. I designed and executed functional, regression, integration, UI, database, and API test cases. I automated key test cases using Selenium with POM and used Jira for defect tracking. I also performed performance and security testing to ensure stability."
Testing Process
The testing process started with:
- Requirement Analysis
- BRD Review
- FRS Review
- Sprint Planning
- Requirement Grooming
After understanding the requirements:
- Test Cases were designed.
- Test Cases were executed.
- Automation Scripts were developed.
- Defects were logged in Jira.
Writing Good Selenium Test Cases
Good Selenium test cases follow standard automation best practices.
Best Practices
- Page Object Model (POM)
- Meaningful Test Names
- Parameterization using DataProvider
- Explicit Waits
- Proper Assertions
- Logging
- Test Independence
- Parallel Execution
- Screenshots on Failure
These practices improve:
- Readability
- Maintainability
- Reliability
FAQs
How Would You Create an Automation Framework from Scratch?
Follow these steps:
- Requirement Analysis
- Tool Selection
- Maven Project Structure
Typical technology stack:
- Selenium
- Java
- TestNG
- Maven
- Extent Reports
- Jenkins
What Types of Testing Have You Performed?
Performed:
- Functional Testing
- Regression Testing
- Smoke Testing
- Sanity Testing
- Integration Testing
- UI Testing
- Database Testing
- API Testing
What Percentage of the Application Is Automated?
Approximately:
- 70–80% Automated
- 20–30% Manual
Automation includes:
- Regression
- Smoke
- Cross-Browser
- Data-Driven
- End-to-End Testing
Manual testing includes:
- Exploratory Testing
- Complex UI Validation
- One-time Scenarios
How Do You Handle CAPTCHA During Automation?
Recommended approaches include:
- Disable CAPTCHA in Test Environment
- Use a Development Team Bypass Key
- Manual Validation when necessary
Avoid direct CAPTCHA automation.
How Do You Write Good Selenium Test Cases?
Follow these best practices:
- Page Object Model
- Meaningful Test Names
- DataProvider
- Explicit Waits
- Assertions
- Logging
- Independent Test Cases
- Parallel Execution
- Failure Screenshots