O2T Selenium Webdriver Framework Introduction
O2T Selenium Webdriver Framework Introduction
DISCLAIMER
Verbatim copying and distribution of this entire article is permitted worldwide, without
royalty, in any medium, provided this notice is preserved.
Table of Contents
TABLE OF CONTENTS
1.
PREFACE ..................................................... 3
2.
3.
2.1.
2.2.
2.3.
4.
FLOW DIAGRAM
5.
CONCLUSION .................................................. 11
www.Open2Test.org
OF THE
Page ii
1.
Preface
Automation testing draws maximum benefits with minimum effort. The
benefit of automation testing is its ability to increase the
efficiency of resources, increase test coverage, and increase the
quality and reliability of the software.
While there are several frameworks that provide support for automated
software testing, this document introduces one particularly effective
type: the Open2Test Test Automation Framework.
In the Open2Test Test Automation Framework, the discrete functional
business events that make up an application are described using
keywords. This approach fosters code reusability, optimum utilization
of the tool, and greater productivity.
www.Open2Test.org
Page 3
2.
Framework Overview
2.1.
Introduction to Framework
Automation testing requires a well-defined approach, based
comprehensive framework, in order to reap maximum benefits.
on
2.2.
Framework Features
In addition to standard features such as performing operations and
verifications
on
the
objects,
the
framework
includes
other
sophisticated features, such as:
1. Use of variables: Variables can be defined and used across the
generated test script. This can be used to capture runtime values,
which can be reused as input elsewhere during test execution.
2. Conditional checking: Conditional constructs such as if can be
implemented using keywords to handle different flows based on
various conditions.
3. Data-driven testing: This framework supports data-driven testing
by importing data from an external data sheet.
www.Open2Test.org
Page 4
2.3.
Framework Benefits
Reusability:
The Open2Test Test Automation Framework is an application-independent
framework that deals with all possible actions and verifications that
can be performed on an object. Therefore, the code for the same
object can be used across different applications.
Duplication of work is minimized at every level. For instance, a user
might have to perform a certain action on an object of a similar
class (e.g., clicking a button) repeatedly. This can be in the same
test case or in a different application altogether. In both cases,
the same code can be reused.
Optimum utilization of the tool:
The framework has the advantage of using keywords as the input for
triggering an action. This well-built framework uses the features of
the tool effectively. For instance, there is a shared object
repository where all the objects required can be added and reused
across the scripts for an application under test.
Less effort:
The effort involved in coding and reviewing is minimal when compared
to other frameworks, since a good percentage of coding is done within
the framework. The tester simply has to enter the keywords, reducing
the time required for coding. Recording is also not required as the
global repository is used. The amount of rework required for
migrating from one application to the other on the same platform is
reduced since the code remains the same.
Increased quality:
The scripts will be of uniform quality since they make use of the
same code.
Greater productivity:
The Open2Test Test Automation Framework
quantitative benefits for automation,
compared to any other framework. This
ongoing maintenance of the test scripts
www.Open2Test.org
Page 5
www.Open2Test.org
Page 6
3.
Framework Architecture
3.1.
Framework Architecture
Architecture forms the foundation of any software application. It
should be robust enough to handle the desired functions efficiently
and effectively. In this approach, the goal is to develop an
application-independent reusable-keyword framework that can be used
directly across any application without spending any extra time on
it.
In order to make all the components of the system work in sync, it is
important to define the components and its functionalities, as well
as the binding relationship between them.
An
Automation
components:
Framework
Architecture
comprises
the
following
Framework
Selenium.java
Abstract Layer
Object Repository
Keyword scripts
External Data
Data Sheets
Global Variables
www.Open2Test.org
Page 7
3.1.1.
Selenium.Java
This is the main framework file that deals with the processing logic
of the keyword scripts so that when the test is executed, the actions
are performed on the application under test. It als interacts with
the Selenium server to launch the browser.
This forms the backbone of the Automation Framework. It involves
importing the test suite, test script, and object repository located
in the form of Excel sheets. It holds the function for customizing
the reports.
3.1.2.
Object Repository
Selenium learns the interface of an application by learning the
applications objects and their corresponding property values and
objects descriptions. The object repository is the place where
Selenium recognizes and stores information such as properties,
values, etc.
With this object repository, the tool identifies the application and
executes the business flows as per the functions in the Test script.
If any one or more of the objects property values in the application
differs from the property values stored in the object repository, the
www.Open2Test.org
Page 8
Keywords
Keywords trigger specific functions in the framework to perform a
specific operation on the desired object in the application. These
keywords are fed as an input Excel sheet.
3.1.4.
3.1.5.
Global Variables
Global variables to be used across all the test cases should be
defined and kept in a common place and should be provided as an input
to the framework. After defining a variable to refer to a test
object, you can use the variable instead of the entire object
hierarchy in other statements. Using variables in this way makes the
script easier to read and maintain. These global variables can also
be used to store runtime values and used again in another script.
3.1.6.
Reporting
After execution of the test script, it is necessary to get the
results of the execution. The reports are customized in the framework
such that the summary report and the detailed report are stored in
html format. This provides report details for which test scripts have
failed or passed while running a test suite. The summary report
provides details of execution, duration, test start time and end
time. The detailed reports describe exceptional cases handled, steps
passed, and steps failed. This helps in performing effective analysis
on the execution report.
www.Open2Test.org
Page 9
4.
www.Open2Test.org
Page 10
5.
Conclusion
Analysis is an important and time-consuming phase of automation
testing. However, 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 Open2Test Test Automation
Framework provides a way to drive productivity and foster code reuse
ultimately enhancing the quality of resulting software.
COPYRIGHT
This library is free software; you can redistribute it and/or modify it under the terms of
the GNU Library General Public License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Library General Public License for more details.
www.Open2Test.org
Page 11