Unit 3 - Test Automation Frameworks
Unit 3 - Test Automation Frameworks
COM-702 (B)
B.Tech 7th SEM
Test Automation
Frameworks
Test Automation Frameworks
2
There are six common types of test automation frameworks, each with their own architecture
and differing benefits and disadvantages.
Disadvantages:
• The scripts developed using this framework aren’t reusable. The data is hardcoded into the test
script, meaning the test cases cannot be re-run with multiple sets and will need to be modified if
the data is altered.
• Maintenance is considered a hassle because any changes to the application will require a lot of
rework. This model is not particularly scalable as the scope of testing expands.
• Examples:
Prototype Testing:
Smoke testing
Demonstration purpose
User acceptance testing
Implementing a modular framework will require testers to divide the application under test into
separate units, functions, or sections, each of which will be tested in isolation.
After breaking down the application into individual modules, a test script is created for each
part and then combined to build larger tests in a hierarchical fashion. These larger sets of tests
will begin to represent various test cases.
A key strategy in using the modular framework is to build an abstraction layer, so that any
changes made in individual sections won’t affect the overarching module.
Advantages of a Modular Framework:
• If any changes are made to the application, only the module and it’s associated individual test
script will needs to be fixed, meaning you won’t have to tinker with the rest of the application
and can leave it untouched.
• Creating test cases takes less effort because test scripts for different modules can be reused.
2. Transaction Module:
1. Tests for deposit, withdrawal, and transfer operations.
2. Ensure accurate balance updates post-transaction.
3. Validate transaction history for correctness and completeness.
3. Loan Processing Module:
1. Tests for applying for a loan, calculating interest, and repaying loans.
2. Check the correctness of eligibility checks for different loan products.
3. Validate repayment schedule generation and interest calculation.
2. Module-based Testing
Objective: Refactor the recorded script into reusable and maintainable modules using a language like Python
with Selenium WebDriver.
• Module Creation:
• Login Module: Function to log in
to the account.
• View Account Module: Function
to navigate to and display account
details.
• Logout Module: Function to log
out of the account.
• Benefits: Each function can be
reused in different tests. Easy to
maintain and update.
Understanding how linear, modular and library framework
14
3. Library/Framework-based Testing
Objective: Use a testing framework like pytest to organize tests better and include setup and teardown
procedures.
Framework Utilization: Using pytest for structured testing, fixtures for setup and teardown, and assertions
to validate test outcomes.
use of pytest fixtures for common functionalities, such as logging into a web application, which is a common
prerequisite for most tests in a web application scenario.
Test Automation Frameworks
15