You are on page 1of 10

Test Automation Framework Selenium

Selenium-Test-Automation-Framework Page 1 of 10
Table of Contents

1. INTRODUCTION....................................................................................3
2. FRAMEWORK STRUCTURE......................................................................4
2.1FunctionLibrary..........................................................................4
2.2 Object Repository......................................................................5
2.3 Test Run Parameters File.................................................6
2.4 Test Data.............................................................................7
2.5 Application Scenario Files (Test Cases).........................................8
2.6 Driver Script...........................................................................9
3. CONCLUSION......................................................................................10

Selenium-Test-Automation-Framework Page 2 of 10
1. Introduction

This document is an attempt to build a Data Driven Test Automation Framework


with functional decomposition approach which can be used across different web
based applications. The main advantage of using this tool is its open source
software & support multiple browsers & platforms.

Selenium-Test-Automation-Framework Page 3 of 10
2. Framework Structure

The framework consists of the following components.


Function Library
Object Repository
Test Run Parameter File
Test Data
Application Scenario Files(Test Cases)
Driver Script
The directory structure in which these components are arranged is as shown below.

2.1 Function Library

In this approach, all the coding logic is in the form of user defined Java script
functions.
All of these functions are stored in function libraries (.java file). While developing
scripts for an application, the end user would make use of these functions from
driver script.
All the function library files (.java files) are kept in the folder which is kept parallel to
src folder which contains the driver script.
Selenium-Test-Automation-Framework Page 4 of 10

2.2 Object Repository

Each application automated has a different object repository file and there is only
one object repository for each application. All the object repository files (.xls file) are
kept in the Test Objects in the directory structure. This makes the maintenance of
the script easy as we just need to update this excel sheet in case the objects are
modified in future.
As we can see in the screen shot attached below of the sample object repository file
which consists of the Test Case ids and corresponding objects for particular test case.
So in the application if some objects are modified then we just need to update in this
excel sheet and not in entire suite for different scripts which uses this value.

Selenium-Test-Automation-Framework Page 5 of 10
2.3 Test Run Parameter File

Test Run Parameter File is a like configuration file which contains information
required to do the initialization settings to the Driver selenium script for a particular
application. The Test Run Parameter File is in the form of a spreadsheet which has
an entry for each application and settings data such as Project Code, Project Name,
Test Suite Name, Test Description, Browser options, Selenium server address,
Selenium port number, Base url and Test results paths.

Selenium-Test-Automation-Framework Page 6 of 10
2.4 Test Data

All the test data is stored in excel sheet. We are using data driven framework along
with functional decomposition approach.
The test data excel sheet consists of the unique test case id and the flag to run that
case in the test suite. The excel sheet might have 100 sets of data, but the user
might want to execute only 10 of them. The flag to run the test case helps in this
situation by providing the user with the option to select only certain sets of data by
choosing the option as YES or NO.

Selenium-Test-Automation-Framework Page 7 of 10
2.5 Application Scenario Files (Test Cases)

All the test cases are stored in excel sheet. The Req. ID/ FS. Ref. column is used as
reference in the test data and object repository excel sheets. While executing a
particular test case scenario all the test steps are executed and the actual results are
compared with the expected results. And based on that the final output is generated
whether a particular test case is Passed or Failed.
In the following diagram the test case ids (ESR4, ESR6 and so on) used in the test
data and object repository excel sheets can be seen in Req. ID/ FS. Ref. column.

Selenium-Test-Automation-Framework Page 8 of 10
2.6 Driver Script

Driver script is a selenium test script which drives the script execution. This test
script calls the individual test scripts which reads the parameters from the test data
excel sheet and makes calls to appropriate functions in the function library.

Selenium-Test-Automation-Framework Page 9 of 10
3. Conclusion

So this is a full fledge functional automation framework using open source tool. The
creation of the script initially is little time consuming but in the long run, the time
spent will be useful during the regression phase. In order to keep up with the pace of
product development and delivery, it is essential to implement effective, reusable
test automation. The Open Source Test Automation Framework provides a way to
drive productivity and foster code reuse ultimately enhancing the quality of
resulting software.

Selenium-Test-Automation-Framework Page 10 of 10

You might also like