Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

selenium

What are the types of frameworks in Selenium?

Fahad Farid

Selenium is a framework used to test web applications. A framework defines rules that are followed to achieve particular results. In selenium, there are many types of frameworks including linear scripting, modular testing, and data-driven. These are explained in detail below.

svg viewer

Types

1. Linear Scripting Framework:

A basic automation framework that used to linearly test small apps. Tests are created and executed individually. This Framework is also sometimes known as the ‘Record and Playback.’

Advantages:

  • Generating test scripts is less time consuming
  • No prior coding knowledge needed
  • Fast and easy

Disadvantages:

  • Autogenerated scripts cannot be used again as the data is hardcoded
  • Need to rewrite for different data sets

2. Modular Testing Framework:

Module wise test scripts are created so that an application is broken into smaller, independent modules whose scripts can run individually.

Advantages

  • Better scalability
  • Individual scripts can be reused
  • Modules are independent and do not rely on each other

Disadvantages

  • Takes more time to analyze test cases
  • Identifying reusable flows is hard
  • Need to rewrite for different data sets
  • Requires coding skills

3. Data-driven Framework:

Data-driven test automation separates test scripts, logic, and data from each other. Automation testing scripts that can run with different parameters being passed to them are created. This test data is kept in external files, e.g., CSV, SQL, or XML.

Advantages

  • It supports multiple data sets
  • Modules are independent and do not rely on each other
  • It is not hardcoded

Disadvantages

  • Require coding skills
  • It takes more time to set up the framework and test data

4. Keyword-driven Testing Framework:

It uses a table format to define keywords or action words for each method to execute. Keyword-drive testing is also called table-driven testing or action word based testing.

Advantages

  • Code is reusable as the same test scripts can be used for multiple use cases
  • Tests can be designed in advance
  • Test scripts work independently
  • Not dependent on test tools

Disadvantages

  • Takes more time to design and requires good test automation skills
  • Setup cost is high

5. Hybrid-driven Testing Framework:

This framework is a mixture of data-driven and keyword-driven testing and can also include any of the frameworks described above. It tries to take the benefits of different structures and combine them to produce a better, more efficient framework.

5. Behavior-driven Testing Framework:

It allows all the parties involved (e.g., the Business Analysts, Developers, etc.) to actively participate in the running of these tests.

RELATED TAGS

selenium

CONTRIBUTOR

Fahad Farid
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring