0% found this document useful (0 votes)
6 views15 pages

Unit 3 - Test Automation Frameworks

The document outlines six common types of test automation frameworks: Linear, Modular Based, Library Architecture, Data-Driven, Keyword-Driven, and Hybrid Testing Frameworks, each with distinct advantages and disadvantages. It provides detailed descriptions of the Linear and Modular frameworks, including their processes, benefits, and challenges, along with examples of their application in scenarios like banking systems. The document emphasizes the importance of selecting the appropriate framework based on project requirements and team capabilities.

Uploaded by

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

Unit 3 - Test Automation Frameworks

The document outlines six common types of test automation frameworks: Linear, Modular Based, Library Architecture, Data-Driven, Keyword-Driven, and Hybrid Testing Frameworks, each with distinct advantages and disadvantages. It provides detailed descriptions of the Linear and Modular frameworks, including their processes, benefits, and challenges, along with examples of their application in scenarios like banking systems. The document emphasizes the importance of selecting the appropriate framework based on project requirements and team capabilities.

Uploaded by

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

SOFTWARE TESTING AND AUTOMATION

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.

1. Linear Automation Framework


2. Modular Based Testing Framework
3. Library Architecture Testing Framework
4. Data-Driven Framework
5. Keyword-Driven Framework
6. Hybrid Testing Framework

Test Automation Fundamentals. Unit 3


Linear Automation Framework
3

 Linear Automation Framework


• With a linear test automation framework, also referred to as a record-and-playback framework, testers
don’t need to write code to create functions and the steps are written in a sequential order. In this process,
the tester records each step such as navigation, user input, or checkpoints, and then plays the script back
automatically to conduct the test.
 Advantages of a linear framework:
• There is no need to write custom code, so expertise in test automation is not necessary.
• This is one of the fastest ways to generate test scripts since they can be easily recorded in a minimal
amount of time.
• The test workflow is easier to understand for any party involved in testing since the scripts are laid out in a
sequential manner.
• This is also the easiest way to get up and running with automated testing, especially with a new tool. Most
automated testing tools today will provide record-and-playback features, so you also won’t need to plan
extensively with this framework.
Test Automation Fundamentals. Unit 3
Linear Automation Framework
4

 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

Test Automation Fundamentals. Unit 3


Linear Automation Framework -example
5  Suppose you are testing a web-based email application like Gmail. You want to automate the process of
logging in, composing a new email, sending it, and then logging out.
 Steps using Record and Playback:
1. Setting Up the Test Environment: First, you set up the testing tool on your computer. This could be a tool
like Selenium IDE, which is popular for web applications.
2. Recording the Test:
1. You start the recording feature in the testing tool.
2. Open your web browser and navigate to the Gmail login page.
3. Enter your username and password to log in.
4. Click on the "Compose" button to start a new email.
5. In the new email form, enter a recipient's email address, a subject, and a message in the body.
6. Click the "Send" button to send the email.
7. Log out of your account.
8. Stop the recording in your testing tool.
3. Generated Script: The actions you performed (clicks, keystrokes, navigations) are recorded by the testing
tool inSoftware
the formTestingof aAutomation.
and script. ForUnit Selenium,
2 this might be in a scripting language like Python, Java, or
directly in Selenese (Selenium’s own scripting language).
Modular Based Testing Framework
6

 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.

Test Automation Fundamentals. Unit 3


Modular Based Testing Framework
7

 Disadvantages of a Modular Framework:


• Data is still hard-coded into the test script since the tests are executed separately, so you can’t
use multiple data sets.
• Programming knowledge is required to set up the framework.
 Examples:
 Banking Application
 Modules:
1. Account Management Module:
1. Tests for creating new accounts, editing existing account details, and closing accounts.
2. Verify that all required fields are validated during account creation.
3. Check the functionality to update customer details, like address or contact information.

Test Automation Fundamentals. Unit 3


Modular Based Testing Framework
8

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.

Test Automation Fundamentals. Unit 3


Library Architecture Testing Framework
9

 Library Architecture Testing Framework


• The library architecture framework for automated testing is based on the modular framework,
but has some additional benefits.
• similar tasks within the scripts are identified and later grouped by function, so the application is
ultimately broken down by common objectives.
• These functions are kept in a library which can be called upon by the test scripts whenever
needed.
 Advantages of a Library Architecture Testing Framework:
• Similar to the modular framework, utilizing this architecture will lead to a high level of
modularization, which makes test maintenance and scalability easier and more cost effective.
• This framework has a higher degree of reusability because there is a library of common
functions that can be used by multiple test scripts.

Test Automation Fundamentals. Unit 3


Library Architecture Testing Framework
10

 Disadvantages of a Library Architecture Testing Framework:


• Test data is still hard coded into the script. Therefore, any changes to the data will require
changes to the scripts.
• Technical expertise is needed to write and analyze the common functions within the test scripts.
• Test scripts take more time to develop.
Example: Banking system
 Step 1: Modularize the System
• Account Management Module: Handles creating, updating, and closing bank accounts.
• Transaction Module: Manages deposits, withdrawals, and transfers.
• Loan Module: Deals with loan applications, approvals, and repayments.
• Customer Service Module: Manages customer inquiries, complaints, and feedback.

Test Automation Fundamentals. Unit 3


Library Architecture Testing Framework
11

 Step 2: Identify Common Functionalities


 Once the system is modularized, the next step is to analyze these modules to identify any
common functionalities that can be abstracted out into shared libraries. These might include:
• Validation Functions: Common checks like validating user input, account numbers, or
transaction limits.
• Database Operations: Frequent database operations such as queries or updates that are used
across different modules.
• Authentication and Security Checks: Ensuring that user sessions are valid, encrypting data,
or verifying user permissions.
• Logging and Error Handling: Standard methods for logging and handling errors throughout
the application.

Test Automation Fundamentals. Unit 3


Understanding how linear, modular and library framework
12
Automating the process of a user logging into their online banking account, viewing account details, and logging
out.
 1. Record and Playback
 Scenario: Automate the process of logging into an online banking account using a tool like Selenium IDE.
• Tasks: Open the bank's webpage, input the username and password, click on the login button, and ensure the user
lands on the dashboard.
• Recording the Actions:
• Launch the Selenium IDE.
• Start recording.
• Open the browser and navigate to the online banking login page.
• Enter the username and password in the respective fields.
• Click the "Log In" button.
• Once logged in, navigate to view the account balance.
• Log out by clicking the "Log Out" button.
• Stop recording.
• Playback: The recorded script can be played back any number of times to ensure the login, viewing the account
Understanding how linear, modular and library framework
13

 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

 Considerations for Selection:


• Project requirements
• Team skills and resources
• Integration capabilities with existing systems

Test Automation Fundamentals. Unit 3

You might also like