Académique Documents
Professionnel Documents
Culture Documents
E-mail ID : muralidhar_yalla@mindtree.com
INDIA
MindTree Limited
STC 2009- Building an Automation Framework around Open Source Technologies - 2 -
1. Abstract
Re-usable test automation frameworks coupled with open-source tools and technologies is a key
solution to shrink test cycle times and related costs. This paper covers an approach for creating a script-
less web application automation framework around SeleniumRC which is robust, flexible, and
extensible. Our experimental results on this framework show increased productivity and ROI, reduced
learning curve and dependency on skilled resources, eliminated usage of commercial tools and manual
configuration. The framework provides ease of script generation & management, concurrent and
remote execution, test data generation and customized reports with screenshots. Preliminary statistics
indicate that the automation framework reduces ~ 40% of total test execution effort per release cycle
under a given scenario.
2.Introduction
Frameworks are built at each level of the testing phase/cycle viz. unit, integration, and system testing.
Each framework is built on a set of rules which are derived based on need analysis.
This paper describes the methodology used in developing a robust web based automation framework
and supported by a case study on how this framework is tuned for ease of use, robust and scalable
framework.
What are the guidelines in building a framework on top of open source test automation technologies?
We need to perform a detailed automation need analysis study, to evaluate the scope and expectations
of the automation framework to be developed. The need analysis is an extensive checklist of generic
questions like “Supported browsers IE6+, FF2+, Safari, Supported platforms, protocols“ etc., which
will enable us to take a decision on go, no-go for developing an independent test automation
framework.
Framework / Automation Objectives: Identify the basic and must have features to be supported by
the framework, which will be the result of your detailed need analysis that gives us a broad wish list of
test automation objectives:
• Powerful framework for organizing test design, automation, execution around keywords, test
report generation and test data generation
• Highly Productive approach of Test Script Generation from English like language organized
as user actions, objects and values
• Framework should offer Library of Reusable Functions, like color validation, image
comparison, file Upload etc., which are extensible
• Easy to use and maintain Framework scripts by business users
• Generates test results in html format consisting of test summary, detailed reporting and with
screenshots.
• Supports component based model for object repository
• Supports Remote and Concurrent execution, which will reduce the total execution time
MindTree Limited
STC 2009- Building an Automation Framework around Open Source Technologies - 3 -
MindTree Limited
STC 2009- Building an Automation Framework around Open Source Technologies - 4 -
How should I start to identify the best open source tools / frameworks for my project?
This is a common question that customers / project teams ask. To accomplish the automation
objectives, the test managers / framework developers should adhere to the best practices as sited below
• Identify categorically the nature of application under test say, thin client / thick client / web
Services etc.,
• Current scope of this framework is considered for a thin client (Web application) automation.
• Prepare a checklist of features that the open source tool should support, ensure that the
automation objectives met or >~50%.
• Identify the open source / freeware tools that best suits your automation objective, say
Selenium-Grid / TestNG for creating concurrent test script execution.
• Perform a functional automation tool evaluation for details refer table1.1, this mechanism for
test automation projects is to correlate, identify the best fit single / multiple combinations of
open source tools that maps your automation objectives.
Figure 1: Sample data depicting the tool evaluation process
MindTree Limited
STC 2009- Building an Automation Framework around Open Source Technologies - 5 -
This paper describes the “Plug and Play” hybrid framework architecture on top of open source tools; as
a best practice this architecture ensure that the
advantages of the multiple tools can be leveraged.
As per the current design and implementation
shown in Figure 4, this framework is scalable
because the controller and the execution scripts are
designed as individual modules / utilities which
give extensibility and ease of maintenance provides
the best scalable solution to run tests in parallel Figure 4: Work Flow-Module level architecture
How do we create a “Plug and Play” framework that best suit my automation objectives, project needs?
Basic components of an automation framework consist of controller, object repository, test data,
execution engine, reporting and error logging and recovery.
• There are three broad approaches in designing a controller. Spreadsheet driven, XML driven
and database driven.
• Spreadsheet driven is proven for its ease of use by manual test engineers and XML driven is
proven for its extensibility, say supports web services testing and database driven is proven for
information security, say automation of Financial projects
• Controller is the core of the framework which is used to govern the execution work flow and
modules listed below
• Configuration Module: This module will load the required test script execution environment to
govern the execution work flow
• Object Repository Module: Web elements / objects stored in spreadsheet format (Figure 6) and
this will provide the same as input to the retailer test scripts
MindTree Limited
STC 2009- Building an Automation Framework around Open Source Technologies - 6 -
• Reporting Module: Custom html reports with screenshots, ReportNG is used which is a plug-
in to TestNG framework
SAF is used for web application testing. The above architecture was chosen as it catered to most of the
core requirements, such as a hybrid driven framework addressing concurrent test script execution,
multiple browser support, extensible, easy to use, data driven testing, execute only failed or passed test
cases and with good reporting. SAF is driven by a simple spreadsheet where the application
configuration, test data, test scripts and other inputs required for the execution of the complete
automation cycle are achieved in simple steps:
• Environment setup
• Develop Test cases
• Master test suite Configuration
• Execute tests
• Report Results
Figure 7: Layered view - SAF
Figure 7 – SAF Layers explains integration of SAF with open source technologies and how each of
these technologies interlinked, revealing the potential of SAF. It contains the following components:
Test environment initialization – Plug and Play design
Test execution engine – Controller driven
Error management and recovery
Status and reporting engine
SAF user has the flexibility to update the configuration file to select and execute tests by customizing
the following parameters (Figure 8):
Base URL of the AUT Type of
Browser
Remote or Local machine
Single or Multiple machines
Test Suite execution speed - fast /
moderate / slow and
Remote test case execution
monitor, which helps capture
intermediate screenshots
Figure 8: Sample Test Suite Configuration
SAF controller / execution engine will start the Selenium-RC server and confirm the status of server
back to the Test Execution engine.
MindTree Limited
STC 2009- Building an Automation Framework around Open Source Technologies - 7 -
Execution engine clearly separates test case design and test framework execution. SAF provides an
easy way to organize test cases and test data. The test execution engine uses ANT to consolidate the
targets and execute them sequentially from starting the selenium server and then running the TestNG
suite file which will execute the test cases in the excel sheet and then shut down the selenium server.
MS Excel was chosen given its ease of use and its capability to choose keywords from the list of drop
down and check boxes. User has the liberty to execute a single step or multiple steps in a test case or
single test suite or multiple test suites.
The test design is performed, based on keywords, web objects, test data and a flag to exclude or include
the test steps / tests cases.
Figure 9 shows a sample test case to launch the application browser, performs login and user actions.
Here one single excel sheet can consists multiple test scripts
Figure 9: Sample test cases filled spreadsheet
MindTree Limited
STC 2009- Building an Automation Framework around Open Source Technologies - 8 -
If the web application under test is undergoing frequent change, SAF user has to update web
components identified web ID/Xpath/DOM in a separate Object Repository spreadsheet in Figure 10
and refer the user defined custom name for that object in all his
scripts this will help to maintain global object repository per
page / module which will help manage/update scripts at one
single place instead of all the individual test scripts. Figure 10: Sample Object Repository
SAF test execution engine helps us to execute the test cases in parallel or in sequence using TestNG
framework and will return the test case execution results in html, email report.
The Test Execution Engine helps in recovery process. It would invoke the application from existing
state and continue test execution from the last aborted test script. TestNG on the other side will help
execute only the failed test cases in a test suite and thereby reducing the verification time. Selenium RC
and TestNG have mechanisms to capture the error logs. In case of a failure or crash, the error log will
be sent as an email along with the test case execution report.
Reporting Engine
The default report of TestNG is comprehensive, but it’s not easy to understand at-a-glance; as a result
SAF is integrated with a ReportNG listener which is a simple HTML reporting plug-in for the TestNG
framework. After the test run is completed an email alert will be sent to the stake holders.
Figure 11: SAF - Test Results Summary Report
MindTree Limited
STC 2009- Building an Automation Framework around Open Source Technologies - 9 -
4.Case Study
A Performance & Talent Management System Case Study snapshot. This is a web based Employee
Performance & Talent Management system that provides companies with superior control over the
lifecycle of performance appraisal. The system has several modules like career development
planning, total goal management, recruiting etc. The purpose of the case study is to pilot the run of
itest Selenium Automation Framework in addressing the challenges listed.
MindTree Limited
STC 2009- Building an Automation Framework around Open Source Technologies - 10 -
5.Conclusion
Acronym Description
URL Universal Resource Locator
AUT Application Under Test
DOM Document Object Model
UDE User Defined Exception
SAF Selenium Automation Framework
Controller Framework Core used in conjunction with execution engine
7.References
Item Description
Reference1: http://www.openqa.org/selenium/
Reference2: http://www.testng.org/
http://agiletesting.blogspot.com/2006/01/useful-tools-for-writing-
Reference3:
selenium.html
8.Biography of the authors
Author1: Muralidhar Yalla (Murali), Sr. Test Specialist in the Innovation Labs team at MindTree.
He has over 10 years of Software Industry experience working on open source functional automation
testing tools like Selenium, Sahi, Watir frameworks like TestNG, PHPUnit, and others, TCM tools and
code coverage tools for Java applications like EMMA and others with various languages including
Java, Perl, PHP, Ruby, and Python on WinXP.
Earlier to MindTree, Murali was with Yahoo Corporation, for 2 years, where he has worked on a
number of projects involving API testing, web services testing and functional automation using various
languages viz. PHP, Perl, shell and others on FreeBSD. He has previous stints at Synopsys, Zensutra,
Havells and Protel where he has worked on world class client / server products and worked in the area
of application development and testing of Device Drivers, worked with various languages like C, IPC
and others on Red-Hat Linux. He also enjoys working with more dynamic, productive, multitasking
and fun languages.
MindTree Limited
STC 2009- Building an Automation Framework around Open Source Technologies - 11 -
9.Appendix
MindTree Limited