0% found this document useful (0 votes)
22 views6 pages

B - Explain of Framework

The Hybrid Driven Automation Framework integrates Data Driven, Method Driven, and Modular Driven approaches to enhance automation flexibility, reusability, and maintainability. It utilizes TestNG for test execution flow, Apache POI for reading test data from Excel, and generates detailed reports using Extent Reports, while also supporting CI/CD integration. Key features include modular organization, parameterization, and the Page Object Model for improved test maintenance and reduced code duplication.

Uploaded by

rajat.kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views6 pages

B - Explain of Framework

The Hybrid Driven Automation Framework integrates Data Driven, Method Driven, and Modular Driven approaches to enhance automation flexibility, reusability, and maintainability. It utilizes TestNG for test execution flow, Apache POI for reading test data from Excel, and generates detailed reports using Extent Reports, while also supporting CI/CD integration. Key features include modular organization, parameterization, and the Page Object Model for improved test maintenance and reduced code duplication.

Uploaded by

rajat.kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Hybrid Driven Automation Framework

Our framework is a Hybrid Driven Framework that combines Data Driven,


Method Driven, and Modular Driven approaches. It is design to make
automation flexible, reusable, and easy to maintain.

 Data Driven: We use an Excel file and a properties file to supply


test data and configuration values. This allows us to run the same
test cases with multiple data sets without altering the test scripts.
 Method Driven: The framework includes reusable methods for
common actions, which reduces code repetition and improves
maintainability.
 Modular Driven: Our framework is organized by modules, with
each module having its own test scripts, making the structure easy
to understand.

A Base Class in the Generic package contains configuration methods


that manage the setup and teardown processes.

Using TestNG annotations like @BeforeTest, @BeforeMethod,


@AfterMethod, and @AfterTest, we control the execution flow:

 @BeforeTest opens the browser.


 @BeforeMethod handles user login, preparing for the test
execution.
 @Test includes actual test scripts located in the test script
package.
 @AfterMethod executes logout.
 Finally, @AfterTest closes the browser after all tests finish.

We use Apache POI to read test data from Excel files, allowing the
framework to dynamically retrieve and apply different data during test
execution.

 Test execution is managed through a TestNG XML suite file.


 After test execution, TestNG generates an HTML report. We
integrate Extent Reports to provide detailed, customizable reports
with visual insights and step-by-step results.
 These reports highlight pass, fail, and skip test cases for easier
analysis. Additionally, TestNG listeners are used to capture
screenshots of failed tests, storing them in a dedicated folder for
quick reference.
 Overall, this Hybrid Driven Framework allows us to handle multiple
data set efficiently, avoid repetitive coding, and maintain a well-
structured, modular design.
 It also integrated with CI/CD pipelines, ensuring smooth test
execution and reporting with detailed Extent Reports.
Q. How do you enhance an automation framework?
 Continuously improve the framework by adding new features or addressing existing
issues.
 Introduce data-driven testing to make the scripts reusable.
 Improve the efficiency by optimizing wait strategies.
 Ensure the framework supports CI/CD integration for seamless automation.

Q. Have you done any refactoring in the test framework or test script? And
what was that?

Yes, I have performed refactoring in my current framework:

 Reorganized Test Scripts: Implemented the Page Object Model (POM) for better
maintainability by separating test logic from UI elements.
 Parameterization: Used TestNG to make test cases more reusable by running them
with different sets of input data.
 Custom Utility Methods: Created reusable utility functions (e.g., for logging,
assertions, and waits) to avoid code duplication.
 Removed Hardcoding: Store data into configuration files and Excel sheets to make
scripts more flexible.

Q. Can you explain the Page Object Model (POM)?


 The Page Object Model (POM) is a design pattern in Selenium that
creates an object repository for web elements.
 It improves test maintenance and reduces code duplication by
creating separate classes for each page.
Q. What is Maven..?
 Maven is a popular build automation and project management tool
used for Java projects.
 It supports a wide range of plugins for various tasks, such as
compiling code, running tests, generating reports, and deploying
applications.
 The pom.xml file is the heart of a Maven project, containing
information about the project.
Q. What is Data-Driven Testing?
Testing the application with multiple inputs or test data which is keeping
external resource file like Property File, Excel File and Database etc. is
called as Data Driven Testing.
Advantage of Data-Driven Testing-:
 Reusability of common data and test script data.
 Maintenance of data in excel or external resource file is easier.
 Modification of data in excel or external file is easier.
 We can test the application with huge volume of data.
 Test data can be created explicitly before the test script execution.

Q. What is TestNG (Test Next Generation)?


TestNG is a unit testing framework tool which is mainly used for Batch
execution.

It provides annotations for defining test cases, supports data-driven


testing, and integrates well with reporting tools.

Advantage or additional features of TestNG


1. Parallel Execution (Cross-Browser Testing)
2. Group Execution
3. Generate the reports (HTML report)
4. Run only failed Test Scripts
5. Additional annotation
6. Listener features

Q. TestNG annotations in Selenium


1. @BeforeSuite -: Runs before the entire test suite.
2. @BeforeTest -: Runs before any test method in the <test> tag.
3. @BeforeClass-: Runs before the first method of the current class.
4. @BeforeMethod-: Runs before each test method.
5. @Test-: Marks a method as a test method.
6. @AfterMethod-: Runs after each test method.
7. @AfterClass-: Runs after all the methods in the current class.
8. @AfterTest-: Runs after all the test methods in the <test> tag.
9. @AfterSuite-: Runs after the entire test suite.
10. @DataProvider-: It allows passing multiple sets of data to a test
method. Useful for data-driven testing.
CI/CD (e.g., Azure Pipelines, Jenkins)

 CI/CD automates the process of testing, building, and deploying


applications. This reduces manual effort and minimizes human
error.
 With CI, developers receive quick feedback on their code changes.
Automated tests run with each commit, helping catch issues early.
 CI/CD pipelines ensure that the deployment process is consistent
across environments (development, testing, and production).
 Automated pipelines allow teams to deploy changes more
frequently, enabling quicker delivery of features.
 CI/CD encourages team collaboration by integrating work from
different developers regularly, making it easier to manage changes
and resolve conflicts.
Git-: Version Control

 Git allows developers to track changes in the codebase.


 This helps manage different versions of software and facilitates
rollbacks if needed.
 It enables the creation of branches, allowing developers to work on
features or bug fixes.
 It supports collaboration among team members by providing a
platform for sharing code and managing contributions effectively.
 It maintains a detailed history of changes, making it easier to
understand the evolution of the codebase.
 Git integrates seamlessly with CI/CD tools, allowing automated
builds and tests to be triggered on code changes.

Q. How Azure pipeline work

Azure Pipelines basics:

 It allows us to define CI/CD workflows using YAML files (azure-pipelines.yml).


 Here we define pipelines, stages, and jobs. A pipeline consists of stages, and each
stage can contain jobs that are run sequentially or in parallel.
 Pipelines are triggered based on events, such as a commit, pull request, or a schedule.
 Azure Pipelines agents execute the tasks defined in these jobs, and Azure provides
detailed job logs for debugging.

How Azure Pipelines works:

 Stages: These represent different steps in the pipeline, like build, test, or deploy.
 Jobs: A job runs a series of steps that are executed sequentially. Jobs can be run on
specific agents or environments.
 Steps: Steps define individual tasks, such as build tasks, testing tasks, and deployment
tasks.
o Common tasks in Azure Pipelines include running Maven, npm, or Docker
commands.
 Triggers: Pipelines are triggered based on code changes or manually. For example, a
pipeline could be triggered by a push to the master branch or a pull request.

Q. Integrate Bitbucket into your automation testing framework.


 Bitbucket stores test scripts in a repository, enabling version control
and team collaboration.
 Developers create branches for test scripts, and once verified,
merge them into the main branch.
 Bitbucket integrates with CI/CD tools like Azure or Jenkins to trigger
automated tests when changes are pushed.

Q. What type of testing do you perform through automation?

1. Functional Testing:
o Validate that the application works as expected (e.g., login functionality, form
submission).
2. Regression Testing:
o Ensure that new changes do not break existing functionality.
3. Cross-Browser Testing:
o Test the application on different browsers (e.g., Chrome, Firefox).
4. API Testing:
o Test backend APIs using tools like Postman or Rest Assured to validate
responses and behaviour.
5. Data-Driven Testing:
o Test the application with multiple sets of input data to check consistency.
6. Smoke Testing:
o Quickly verify that the core functionalities are working after a build.
7. Integration Testing:
o Check how different modules of the application interact with each other.
8. End-to-End Testing:
o Validate complete workflows, such as user registration to order placement.

Automation testing helps save time, improve accuracy, and allows frequent execution of
repetitive tests.

Q. Challenges in running a suite?

 Test Flakiness: Some tests fail randomly due to environment or timing issues.
 Long Execution Time: A large suite takes time to execute.
 Environment Dependencies: Issues with test environments or configurations.
 Parallel Execution Errors: Conflicts arise when tests run simultaneously.

Q. What are the things to consider when creating a framework?

 Modularity: Ensure the framework is easy to maintain and extend.


 Reusability: Create reusable components like utility functions and helper classes.
 Scalability: Design it to handle an increasing number of tests.
 Integration: Support CI/CD tools like Jenkins or Azure Pipeline.
 Reporting: Include detailed test reports for better analysis.

Q. Have you worked as an individual contributor?


 I handled test planning, execution, defect logging, and automation independently,
ensuring the deliverables were of high quality.

Q. How will you approach automation for a project still in development?

1. Understand Requirements: Get clarity on the application’s features and architecture.


2. Identify Automatable Areas: Start with stable, reusable, and repetitive tasks.
3. Framework Setup: Create a basic automation framework for scalability.
4. Start with Smoke Tests: Automate core functionalities that are less likely to change.
5. Update Regularly: Adapt scripts as the development progresses.
6. Communicate with the Team: Sync with developers to understand ongoing changes.

Q. What should not be automated and left to the manual team?

 Exploratory Testing: Requires human judgment and creativity.


 One-Time Tests: Unlikely to repeat, such as UI layout verification.
 Highly Dynamic Tests: Frequently changing UI elements.
 Usability and Visual Testing: Best done manually to capture subtle issues.

Q. Have you worked as part of a big team? How did you divide tasks and
deliver?

 Yes, I worked in a big team.


 Tasks were divided based on skill sets and priorities. For example:
o One person handled test case creation.
o Another handled automation scripting.
o Others focused on execution, defect logging, and reporting.
 Regular stand-ups ensured smooth collaboration and on-time delivery.

Q. How do you handle exceptions in automation testing frameworks?

 In Selenium, I handle exceptions like NoSuchElementException or


TimeoutException using a try-catch block.
 I log the exception details into a report (e.g., using TestNG or custom reporting).
 Example:

try {
WebElement element = driver.findElement(By.id("submit"));
element.click();
} catch (NoSuchElementException e) {
System.out.println("Element not found: " + e.getMessage());
}

You might also like