QA and Software Testing | 40 questions | 2026
Automation Framework Interview Questions and Answers
Automation Framework interview questions for freshers 16
Q1FresherMost askedAnswerHideWhat is a test automation framework and what types are there?
A test automation framework is a set of structure, libraries, rules and tools. It makes automated tests easy to write, run, report and maintain. It is more than a pile of scripts.
Common types:
- Linear (record and playback): simple, but no reuse and hard to maintain.
- Modular: tests are built from reusable page or function modules.
- Data-driven: the same test logic runs with many rows of data from files.
- Keyword-driven: test steps are written as keywords (login, search) that map to code.
- Hybrid: a mix of these. Most real projects use this.
- BDD: scenarios are written in Gherkin (Cucumber, SpecFlow, Behave) and linked to step code.
What they are checking: Whether you see a framework as a design, not just a set of tools
Q2FresherMost askedAnswerHideWhat is the difference between data-driven, keyword-driven and hybrid frameworks?
| Type | Idea | Typical input |
|---|---|---|
| Data-driven | One test script runs again and again with different data | CSV, JSON, Excel, DB |
| Keyword-driven | Test steps are keywords (Login, AddToCart) written in code, so non-programmers can build tests | Spreadsheet or Robot Framework file |
| Hybrid | Mixes page objects, data-driven inputs and sometimes keywords or BDD | Mixed |
Data-driven testing means fewer copied scripts. Keyword-driven testing lets manual testers help, but you must maintain the extra layer that turns keywords into code. Hybrid is the practical choice. Use page objects for structure, parametrised data for coverage, and readable test names.
What they are checking: Whether you can tell the approaches apart and pick one
Q3FresherMost askedAnswerHideWhat is BDD and how does Cucumber work?
Behaviour-driven development (BDD) describes behaviour in plain language. Product, QA and developers all share it. Cucumber runs Gherkin scenarios. It matches each line to a step definition in code.
Feature: Login
Scenario: Valid user signs in
Given the user is on the login page
When they sign in with valid credentials
Then they see the dashboard
from behave import given, when, then # same idea as Cucumber step definitions
@when("they sign in with valid credentials")
def step(context):
context.login_page.sign_in("demo", "demo-pass")
Benefits: the scenarios work as living documentation, and everyone understands the feature the same way. Costs: you maintain an extra layer. It also fits poorly if business people never read the files. Keep scenarios short and about intent, not click-by-click.
What they are checking: Whether you understand the value and the cost of BDD
Q4FresherMost askedAnswerHideWhat is the test pyramid and why does it matter?
The test pyramid says to have many fast unit tests at the base. Have fewer integration or API tests in the middle. Have few UI end-to-end tests at the top.
- Unit tests: take milliseconds, show exactly what failed, and are cheap to maintain.
- API / integration tests: check business rules and contracts without a browser.
- UI tests: the slowest and the easiest to break. Keep them for the most important user journeys.
An upside-down pyramid (mostly UI tests) gives slow pipelines, unstable builds and high maintenance cost. Check each thing at the lowest level that can catch the bug.
What they are checking: Whether you understand cost and speed of feedback
Q5FresherMost askedAnswerHideWhat should you automate and what should you not automate?
Automate tests that repeat often, are stable, matter a lot and give the same result every time:
- Regression and smoke checks that run on every build.
- Data-heavy checks with many input combinations.
- API and integration tests, and cross-browser checks of key flows.
- Anything that needs exact timing or large volumes that people cannot do.
Do not automate:
- Features that still change every day.
- One-off tests and exploratory testing.
- Usability, look-and-feel checks and anything that needs human judgement.
- Tests that cost more to maintain than the time they save.
A simple rule: automate when the test will run many times, rarely changes, and a failure matters.
What they are checking: Whether you think about return on effort (ROI)
Q6FresherMost askedFree with sign-inAnswerHideHow do you test an API? What do you check?
Check more than the status code.
Q7FresherMost askedFree with sign-inAnswerHideWhat is the difference between smoke, sanity and regression testing?
| Type | Purpose | Scope |
|---|---|---|
| Smoke | Is the build stable enough to test at all? | Shallow, wide checks of critical functions |
| Sanity | Did a specific fix or small change work, without breaking its area? | Narrow and focused, often not scripted |
| Regression | Did recent changes break existing... |
Q8FresherMost askedFree with sign-inAnswerHideWhat is the difference between severity and priority, and describe the bug life cycle.
Severity is the technical impact of the defect (crash, data loss, cosmetic). Priority is how soon it should be fixed. That is a business decision. A typo in the company name on the home page is low severity but high priority. A crash in a rarely used admin screen is high severity but may be low priority.
Q9FresherMost askedFree with sign-inAnswerHideWhat does a good folder structure for an automation framework look like?
Group by job, so people know where code goes:
Q10FresherMost askedFree with sign-inAnswerHideHow do you do reporting in an automation framework?
Reports should quickly answer "what failed, why, and where".
Q11FresherMost askedFree with sign-inAnswerHideWrite pseudocode or code to reverse a string without using a built-in reverse.
Swap the characters from both ends. Or build the result backwards.
Pseudocode:
Q12FresherMost askedFree with sign-inAnswerHideWhat is the difference between a test strategy and a test plan?
A test strategy is a high-level document that lasts a long time. It describes the overall approach: test levels, types, tools, environments, automation approach, risk handling, metrics and roles. It applies across projects or the whole product.
Q13FresherMost askedFree with sign-inAnswerHideHow do you measure the return on investment of test automation?
Compare two things. One is the cost of building and maintaining automation. The other is the manual effort and bug cost that it removes.
Simple view: savings = (manual run time x number of runs) minus (build time + maintenance time).
Q14FresherMost askedFree with sign-inAnswerHideWhich Git commands and practices should a QA engineer know?
Core commands: git clone, git status, git add, git commit, git pull --rebase, git push, git branch. More: git switch -c feature/x, git merge, git diff, git log --oneline, git stash.
Q15FresherMost askedFree with sign-inAnswerHideWhat logging and exception handling do you build into an automation framework?
Good logging lets you find the cause of a failure without running the test again.
Q16FresherMost askedFree with sign-inAnswerHideHow do you manage configuration, environments and secrets in a framework?
Keep the code the same in every environment. Change only the configuration.
Automation Framework interview questions for experienced 11
Q17ExperiencedMost askedAnswerHideHow do you integrate automated tests into a CI/CD pipeline?
Run the tests automatically at the right stage, and give fast feedback.
- Trigger: on pull request (smoke, API and key UI tests). Also on merge or on a schedule (full regression).
- Stages: build, unit tests, deploy to a test environment, API tests, UI tests, report.
- Run headless in containers, in parallel, with the same image every time.
- Make the quality gate real. The pipeline fails when a test fails or coverage drops. A failed run blocks the merge.
- Publish reports, screenshots and traces. Tell the team.
- Keep secrets in the CI secret store. Manage test data with setup steps or API seeding.
Keep the PR suite under about 10 minutes. If it is slower, developers will find ways to skip it.
What they are checking: Whether you know pipeline stages, gates and speed
Q18ExperiencedMost askedAnswerHideHow do you manage test data in automation?
Tests must create or control their own data. Then they can run in parallel and in any order.
- Prefer to create data for each test through APIs, factories or database seeds. Use unique values (timestamps or UUIDs).
- Clean up afterwards. Or use disposable environments and database snapshots.
- Keep fixed reference data in JSON or CSV files under version control.
- Never use real personal data from production. Use masked or made-up data.
- Keep data separate for each environment. Keep credentials in a secret store.
- Avoid tests that depend on data left behind by another test.
After timing problems, bad data management is the second biggest cause of unstable tests (tests that pass sometimes and fail other times).
What they are checking: Whether you can keep tests independent
Q19ExperiencedMost askedAnswerHideHow do you use AI tools in your QA workflow?
I use AI as an assistant that I check. I do not treat it as an authority.
- Test design: ask it for edge cases, equivalence classes and negative scenarios from a requirement. Then I remove weak ideas and verify the rest.
- Test code: create the first version of page objects, data builders and repeated setup code. Ask it to explain failing stack traces.
- Test data: make realistic made-up datasets (never real customer data).
- Bug reports: turn rough notes into clear steps, expected result and actual result.
- Triage: summarise logs and group similar failures.
Safety rules: do not paste secrets or private data into outside tools. Always run and review generated code. Check every claim against the real application. AI makes drafts faster, but the tester still judges the risk.
What they are checking: Whether you use AI in a practical and safe way
Q20ExperiencedMost askedFree with sign-inAnswerHideShow a basic CI pipeline for running automated tests in GitHub Actions and Jenkins.
GitHub Actions:
Q21ExperiencedMost askedFree with sign-inAnswerHideHow do you test the database layer?
Test data integrity, structure and behaviour.
Q22ExperiencedMost askedFree with sign-inAnswerHideWhat is shift-left testing?
Shift-left means testing earlier in the lifecycle. Then bugs are found when they are cheap to fix.
Q23ExperiencedMost askedFree with sign-inAnswerHideWhat QA metrics do you track and which are misleading?
Useful metrics:
- Defect leakage (bugs found in production divided by all bugs).
- Defect detection percentage, and the time to find and fix bugs.
- Automation pass rate, rate of unstable tests, and suite run time.
- Requirement or risk coverage.
- Mean time to restore test environments.
Q24ExperiencedMost askedFree with sign-inAnswerHideHow do you test for security as a QA engineer?
I cover the common risks and work with security specialists for deeper checks.
Q25ExperiencedMost askedFree with sign-inAnswerHideWhat is contract testing and when is it useful?
Contract testing checks that a service consumer and a provider agree on the shape of requests and responses. You do not need to run both together. With Pact, the consumer writes its expectations, and these create a contract. The provider checks the contract in its own pipeline.
Q26ExperiencedMost askedFree with sign-inAnswerHideHow do you review test code and keep coding standards in a QA team?
Treat test code like production code.
Q27ExperiencedMost askedFree with sign-inAnswerHideWhat is a test environment strategy and what problems does it solve?
It defines which environments exist, what each one is for, and how to keep them reliable. A typical set: local, short-lived CI environments, shared test/QA, staging (like production), and production monitoring.
Scenario based Automation Framework interview questions 13
Q28ExperiencedMost askedScenarioAnswerHideHow would you design a test automation framework from scratch?
I would start from goals, not tools.
- Clarify scope: app type (web, API, mobile), team skills, release speed, environments, and what must run on each pull request.
- Choose a stack that fits the team. For example, Playwright with TypeScript, or Selenium with Java and TestNG. Add a runner and an assertion library.
- Define layers: tests, page objects or API clients, shared helpers, config, and test data factories.
- Build in common needs from day one. These are environment config, secrets handling, logging and a retry policy. Add reporting (Allure or HTML), screenshots and traces on failure, and tags for smoke and regression.
- Set up CI with a fast smoke suite on each PR and a nightly regression. Run them in parallel in containers.
- Write coding rules. Review tests like production code. Document how to add a test.
- Start with a small suite of high-value tests. Prove it is stable, then grow it.
Success means people trust the results: few unstable tests (tests that pass sometimes and fail other times), quick feedback and low maintenance cost.
What they are checking: Whether you design for easy maintenance and team use
Q29ExperiencedMost askedScenarioAnswerHideHow do you deal with unstable tests (tests that pass sometimes and fail other times) in an automation suite?
I measure, find the cause, fix and prevent.
- Measure: track how often each test fails and passes from CI history. Mark the unstable tests. Do not guess.
- Find the root cause. It may be timing and waiting problems, shared or old data, or tests that depend on order. It may be an unstable environment or third-party services. It may also be a real product bug that appears only sometimes.
- Fix the cause: waits based on conditions, unique data per test, mocks for unstable services, stable locators, and isolation.
- Quarantine (set aside) tests that cannot be fixed quickly, so the pipeline stays trusted. Give each one an owner and a deadline.
- Prevent: review new tests. Run them many times (for example 20) before merging. Allow at most one retry.
If the team ignores unstable tests, people learn to ignore red builds.
What they are checking: Whether you treat unstable tests as an engineering problem
Q30ExperiencedMost askedScenarioFree with sign-inAnswerHideTell me about a project you led and your responsibilities.
Use a clear structure: context, your role, actions, result.
Q31ExperiencedMost askedScenarioFree with sign-inAnswerHideHow would you plan testing for a large e-commerce website?
I would use a risk-based plan, ordered by business impact.
Q32ExperiencedMost askedScenarioFree with sign-inAnswerHideHow would you use AI to triage bugs and draft bug reports?
I would use AI to reduce routine work. A person confirms the decisions.
Q33ExperiencedMost askedScenarioFree with sign-inAnswerHideHow do you mentor and onboard junior testers?
I give structure, early wins and feedback.
Q34ExperiencedMost askedScenarioFree with sign-inAnswerHideHow do you decide on release sign-off?
Sign-off is a risk decision based on evidence. The team agrees the exit criteria (the conditions to release) in advance.
Q35FresherMost askedScenarioFree with sign-inAnswerHideYou are asked to find bugs in a simple todo list app in 15 minutes. How do you approach it?
Explore in an organised way and report clearly.
Q36ExperiencedMost askedScenarioFree with sign-inAnswerHideThe UI changes often and your automation keeps breaking. What do you do?
Reduce how much the tests depend on UI details.
Q37ExperiencedMost askedScenarioFree with sign-inAnswerHideYour regression suite fails on every build and the team stops trusting it. What do you do?
Win back trust first, then improve.
Q38ExperiencedMost askedScenarioFree with sign-inAnswerHideHow do you decide what to test when time before release is short?
Use risk-based priorities.
Q39ExperiencedMost askedScenarioFree with sign-inAnswerHideHow would you test a third-party integration end to end?
I would test at several levels, because I do not control the other system.
Q40ExperiencedMost askedScenarioFree with sign-inAnswerHideHow do you choose between tools, for example Selenium, Playwright or Cypress, for a new project?
I decide using criteria, then I run a short proof of concept.
Criteria: app type and browser needs, team language skills, stability and speed, parallel runs and CI fit, and debugging tools. Also community and long-term support, cost, and fit with existing reporting.