0% found this document useful (0 votes)
19 views18 pages

Unit 3

The document outlines a course on Software Testing and Automation, focusing on various testing frameworks including Linear, Modular, Library Architecture, Data-Driven, Keyword-Driven, and Hybrid frameworks. It discusses the advantages and limitations of each framework, particularly emphasizing the importance of separating test data from script logic to enhance flexibility and maintainability. Additionally, it highlights the need for skilled testers to effectively implement these frameworks and manage test data.

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)
19 views18 pages

Unit 3

The document outlines a course on Software Testing and Automation, focusing on various testing frameworks including Linear, Modular, Library Architecture, Data-Driven, Keyword-Driven, and Hybrid frameworks. It discusses the advantages and limitations of each framework, particularly emphasizing the importance of separating test data from script logic to enhance flexibility and maintainability. Additionally, it highlights the need for skilled testers to effectively implement these frameworks and manage test data.

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/ 18

Course Name- Software Testing and Automation

Course Code-COM-702(B)
Lecture No-

Topic – Introduction to testing frameworks


Date-

Model Institute of Engineering & Technology


Course Outcomes

By the end of the course, students shall be able to:

CO1 Understand written algorithms in terms of their composite steps and transformations.

CO2 Analyze time and space complexity of well-known algorithms.

CO3 Understand various algorithm design techniques.

CO4 Understand P, NP and NP-Complete algorithms and their characteristics.

CO5 Gain understanding of applicability of algorithms in devising optimal solutions to


given problems in diverse domains.
Lecture : Learning Outcomes

At the end of the Lecture, the student shall be able to :


Sr. No.

1 Understand the Objectives of Learning Algorithms.

2 Describe the Characteristics and Implementation of Algorithms.

3 Illustrate the Phases of Algorithm Construction (Design, Validation, Analysis and Testing).

4 Elaborate the significance important tools for Algorithm Analysis

5 Describe the Mathematical Model of a Computer: RAM Model of Computation.


Test Automation Frameworks
4

 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


Limitation of library Framework
5

Definition:
A testing approach where common functions and procedures are stored in shared libraries.
These libraries are accessible to multiple test scripts, which can call the functions as needed,
thereby reducing redundancy and promoting code reusability.
Limitations of library framework
Test data is often hardcoded directly into the test scripts. This means that any changes in the
test data require modifications to the scripts themselves, which can be time-consuming and
prone to errors. It's a simple method but has the disadvantage of low flexibility and high
maintenance, especially when dealing with a large number of test cases or frequent changes
in test data.
Example: E-commerce Application Testing: Imagine a test script is written for
an e-commerce website to verify that the login functionality works as expected.
The script includes hardcoded credentials, such as a username and password.

Test Automation Fundamentals. Unit 3


Limitation of library Framework
6

Script that hard codes for


username and password

Scenario Requiring Script


Change:
1. Change in credentials
2. Change in functionality
3. Environmental change
4. UI change

Test Automation Fundamentals. Unit 3


Data- driven framework
7

 Using a data-driven framework separates the test data from script logic,
meaning testers can store data externally.
 Very frequently, testers find themselves in a situation where they need to test
the same feature or function of an application multiple times with different sets
of data. In these instances, it’s critical that the test data not be hard-coded in the
script itself, which is what happens with a Linear or Modular-based testing
framework.
 Setting up a data-driven test framework will allow the tester to store and pass
the input/ output parameters to test scripts from an external data source, such as
Excel Spreadsheets, Text Files, CSV files, SQL Tables, or ODBC repositories.
 The test scripts are connected to the external data source and told to read and
populate the necessary data when needed.

Test Automation Fundamentals. Unit 3


Data- driven framework- example
8

 CSV file example: Contains rows of user credentials and the expected
accessibility or outcomes.

 Test Script:
• The script reads the test data, logs in with the provided credentials, and checks
whether the user can access specific features according to their role.
 Functions Library:
• Common functions used across various tests like login(), checkAccess(),
logout(), etc., stored in a library.
Test Automation Fundamentals. Unit 3
Data- driven framework- example
9
• import csv # Verify access to features
• from selenium import webdriver • result = check_access(driver, row['UserRole'])
• from user_functions_library import login, • assert result == (row['ExpectedAccess'] ==
check_access, logout 'True'), f"Access test failed for {row['UserRole']}"

• # Open test data file • # Optionally check specific outcomes or


• with open('user_permissions_test_data.csv', further actions based on role
mode='r') as file: • if row['ExpectedOutcome'] != 'Login Failed':
• reader = csv.DictReader(file) • assert check_specific_feature(driver,

row['ExpectedOutcome']), f"Feature test failed for
{row['UserRole']}"
• # Setup WebDriver •
• driver = webdriver.Chrome() • # Log out

• logout(driver)
• for row in reader: •
• # Log in to the application • # Close the browser
• login(driver, row['Username'], • driver.quit()
row['Password'])

Test Automation Fundamentals. Unit 3


Data- driven framework-advantage
10

 Advantages of a Data-Driven Framework:


• Tests can be executed with multiple data sets.
• Multiple scenarios can be tested quickly by varying the data, thereby reducing
the number of scripts needed.
• Hard-coding data can be avoided so any changes to the test scripts do not affect
the data being used and vice versa.
• You’ll save time by executing more tests faster.

Test Automation Fundamentals. Unit 3


Data- driven framework-disadvantage
11

Disadvantages
 You’ll need a highly-experienced tester who is proficient in various programming

languages to properly utilize this framework design.


 They will need to identify and format the external data sources and to write code (create

functions) that connect the tests to those external data sources seamlessly.
 Data Management Overhead: Maintaining the test data can become a significant

overhead. The data files (or databases) need to be kept up-to-date and organized. As the
amount of test data grows, so does the effort required to manage it.
 Increased Execution Time: Running tests with multiple sets of data can significantly

increase the total execution time for test suites. This can impact the feedback loop in
continuous integration environments where quick test results are desirable.

Test Automation Fundamentals. Unit 3


Keyword- driven framework
12

 In a keyword-driven framework, each function of the application under test is laid out in
a table with a series of instructions in consecutive order for each test that needs to be
run.
 In a similar fashion to the data-driven framework, the test data and script logic are
separated in a keyword-driven framework, but this approach takes it a step further.
 With this approach, keywords are also stored in an external data table (hence the name),
making them independent from the automated testing tool being used to execute the
tests.
 Keywords are the part of a script representing the various actions being performed to
test the GUI of an application. These can be labeled as simply as ‘click,’ or ‘login,’ or
with complex labels like ‘clicklink,’ or ‘verifylink.’

Test Automation Fundamentals. Unit 3


Keyword- driven framework
13

 In the table, keywords are stored in a step-by-step fashion with an associated object, or
the part of the UI that the action is being performed on. For this approach to work
properly, a shared object repository is needed to map the objects to their associated
actions.

Test Automation Fundamentals. Unit 3


Keyword- driven framework
14

 Once the table has been set up, all the testers have to do is write the code that will
prompt the necessary action based on the keywords. When the test is run, the test data is
read and pointed towards the corresponding keyword which then executes the relevant
script.

 Advantages of Keyword-Driven Frameworks:


• Minimal scripting knowledge is needed.
• A single keyword can be used across multiple test scripts, so the code is reusable.
• Test scripts can be built independent of the application under test.

Test Automation Fundamentals. Unit 3


Keyword- driven framework
15

 Disadvantages:
• The initial cost of setting up the framework is high. It is time-consuming and complex.
The keywords need to be defined and the object repositories / libraries need to be set up.
• You need an employee with good test automation skills.
• Keywords can be a hassle to maintain when scaling a test operation. You will need to
continue building out the repositories and keyword tables.

Test Automation Fundamentals. Unit 3


Hybrid Test Automation Framework
16

 As with most testing processes today, automated testing frameworks have


started to become integrated and overlap with one another. As the name
suggests, a hybrid framework is a combination of any of the previously
mentioned frameworks set up to leverage the advantages of some and mitigate
the weaknesses of others.
 Every application is different, and so should the processes used to test them. As
more teams move to an agile model, setting up a flexible framework for
automated testing is crucial. A hybrid framework can be more easily adapted to
get the best test results.

Test Automation Fundamentals. Unit 3


Benefits of Hybrid
17

 Improved Readability and Accessibility: The use of keywords makes the test cases
easily understandable by non-technical stakeholders, promoting better collaboration.
 Increased Reusability: By modularizing test cases and reusing keywords across
different tests, a hybrid framework can significantly reduce the effort required to write
and maintain tests.
 Enhanced Flexibility: Testers can choose the most appropriate testing strategy for each
aspect of the application, whether it's using data-driven techniques for regression tests or
BDD for new features.
 Scalability: Hybrid frameworks can scale more effectively with the complexity of the
application, as they can handle both simple and complex test scenarios efficiently.

Test Automation Fundamentals. Unit 3


SUMMARY
18
 Linear Framework:
• Description: Executes tests step-by-step in a simple, sequential manner.
• Use Case: Best for small, straightforward projects.
 Modular Framework:
• Description: Divides the application into separate units or modules tested independently.
• Use Case: Useful for larger projects to enhance test maintainability and reusability.
 Library Architecture Framework:
• Description: Common functions are stored in libraries and called by various test scripts, reducing
redundancy.
• Use Case: Ideal for projects with reusable components, improving efficiency.
 Keyword-Driven Framework:
• Description: Uses human-readable keywords to represent actions, making scripts easy to understand.
• Use Case: Suitable for teams with non-technical stakeholders to facilitate better communication.
 Hybrid Framework:
• Description: Combines elements of other frameworks to capitalize on their strengths and mitigate
weaknesses.
• Use Case: Best for complex projects
Test requiring
Automationflexibility andUnit
Fundamentals. scalability.
3

You might also like