Debug School

rakesh kumar
rakesh kumar

Posted on

listout checklist of Main Components of Keyword Driven Framework in Selenium python

A Keyword-Driven Framework in Selenium is a test automation framework where test cases are designed using a set of keywords that represent actions, validations, and operations to be performed on a web application. Here is a checklist of the main components of a Keyword-Driven Framework along with an example and what the output might look like:

Components of a Keyword-Driven Framework

Keyword Repository:

A library or collection of keywords representing test actions, such as "click," "type," "verify," etc.
Each keyword corresponds to a specific Selenium action.
Test Data:

Test data is a separate data source that provides input values or expected results for test cases.
Data can be stored in an Excel file, a CSV file, a database, or any other structured format.
Test Case:

A test case is designed using keywords from the keyword repository.
Test cases define the flow of test steps using keywords and reference test data for input and validation.

Image description

Test Runner:

The test runner reads and executes the test cases using keywords and test data.
The test runner may be a Python script, a testing framework, or a custom application.

Generate reports that capture the results of test case execution.
Reports can include pass/fail status, execution time, and details about test steps.
Configuration Management:

Manage test environment configurations (e.g., URLs, browsers, credentials) separately from test cases.
Example of a Keyword-Driven Framework:

Suppose you have a keyword repository as follows:

open_browser: Opens a web browser.
navigate_to: Navigates to a specified URL.
enter_text: Types text into an input field.
click_button: Clicks a button.
verify_text: Verifies text on a web page.
close_browser: Closes the web browser.
Enter fullscreen mode Exit fullscreen mode

Your test data is stored in an Excel file, and you have a test case like this:

Image description

Image description

Main Components of Keyword Driven Framework in Selenium

There are some common components for each keyword driven automation framework that you need in order to create a Selenium keyword driven framework. They are as follows:

  1. Excel Sheet: It is used to store keywords and data required for test cases, test steps, test objects, and test actions

  2. Object Repository: These are property files that are used to store locator values of web elements present in the application.

A property file is a text file where data is stored in the form of key-value pairs. These property files act as an object repository in Selenium WebDriver.

  1. Function Library: Functions library plays an important role that is used to perform actions. These functions that we create, should be tied up with keywords.

  2. Test Data Sheet (Generally in Excel format): This is an excel file that is used to store data values within objects to perform actions on them.

  3. Test Scripts: Test scripts perform operations on AUT (Application under test) with the help of Library functions and Test Data.

  4. Driver Script: Driver script is the heart of the keyword driven framework in selenium. This script is also known as execution engine.

This is the main script that interacts with all test scripts. The driver script does so with the help of Library functions.

The main task that is accomplished by driver script, is to read data from environment variables, read excel file, call functions mapped to keywords, and log the result.

  1. Selenium – Setting and Environment variables.

Top comments (0)