Web Automation Using Selenium
  • About The Book
  • Selenium
    • Introduction
      • What is testing and why?
      • What is Selenium and Why?
    • Getting Started
      • Audience
      • Prerequisite
      • Set up
      • Getting Started - Hello World..!!
      • What are drivers
    • Locators
      • CSS Selectors
      • XPath Selector
    • WebDriver
      • WebDriver Methods
      • WebDriver Types
    • WebElement(s)
      • WebElement Methods
      • Looping Through WebElements
    • Waits In Selenium
  • TestNG
    • Introduction
    • TestNG Setup
    • First Test Script
    • Some of the features of TestNG
    • TestNG Annotations
      • @Test
      • @DataProvider
  • Maven
    • Introduction
  • Framework Development
    • Introduction
    • Building Framework
      • Technology Stack
      • Page Object Model (POM)
      • Setup
      • What our framework contain
      • Packages
        • Context
        • Factory
        • Listeners
        • Pages
      • Creating first automation test
  • Common Interview Questions
    • Selenium-Related
Powered by GitBook
On this page
  • What is a Framework?
  • Our automation Framework

Was this helpful?

  1. Framework Development

Introduction

Why we need a framework ?

Now we are pretty much aware what selenium can do and how to do it. Even though that is enough to automate a single flow or a test case. But eventually when number of test cases increase, this code will become hard to maintain. Some of those maintenance issues are

  1. If we need any proof of the test case we need to explicitly write code for it and we need to do that in all the test cases that we've coded.

  2. We can not run multiple of those test cases if we have written them in different classes.

  3. Logging and reporting is hard to maintain in all of those classes. And etc.,

What is a Framework?

Here is definition from Wikipedia.

In computer programming, a software framework is an abstraction in which software providing generic functionality can be selectively changed by additional user-written code, thus providing application-specific software. - Wikipedia

In our scenario most of the common functions that we use while writing an automation test case like,

  1. The way we run them.

  2. The way we assert the conditions.

  3. The way we Log.

  4. The way we Create a report, etc.,

Is common across all the test cases we are going to automate. Only the flow is going to change in these test cases. So we will include all this commonly used functions (Boilerplate) in our framework.

So essentially the framework that we are going to develop is not the exact automation code itself, in contrast it'll have all the necessary components to develop automation test cases. And the goal is to enable the user of this framework to create an automation test case with least or no boilerplate code.

Our automation Framework

To automate our test cases, we can either

  1. Develop a framework from scratch or

  2. Use an existing framework or,

  3. By building on on top of existing framework(s) according to our needs We can overcome above stated problems.

In this section we are following the 3rd approach.

PreviousIntroductionNextBuilding Framework

Last updated 5 years ago

Was this helpful?