Data Driven Testing Framework using Selenium WebDriver



Similar documents
With the use of keyword driven framework, we can automate the following test scenarios for Gmail as under :-

GLOBAL JOURNAL OF ENGINEERING SCIENCE AND RESEARCHES

Comparative Analysis of Open Source Automated Software Testing Tools: Selenium, Sikuli and Watir

AUTOMATING THE WEB APPLICATIONS USING THE SELENIUM RC

Viewpoint. Choosing the right automation tool and framework is critical to project success. - Harsh Bajaj, Technical Test Lead ECSIVS, Infosys

Selenium Automation set up with TestNG and Eclipse- A Beginners Guide

QEx Whitepaper. Automation Testing Pillar: Selenium. Naveen Saxena. AuthOr:

DESIGN OF AUTOMATION SCRIPTS EXECUTION APPLICATION FOR SELENIUM WEBDRIVER AND TestNG FRAMEWORK

A Keyword Driven Framework for Testing Web Applications

Designing a Software Test Automation Framework

A Comprehensive Review of Web-based Automation Testing Tools

Testing Tools Content (Manual with Selenium) Levels of Testing

Keyword-Driven Testing Framework For Android Applications

Domain Specific Languages for Selenium tests

SOFTWARE TESTING TRAINING COURSES CONTENTS

BDD FOR AUTOMATING WEB APPLICATION TESTING. Stephen de Vries

Comparative Study of Automated Testing Tools: Quick Test Pro and Load Runner

Automated Data Validation Testing Tool for Data Migration Quality Assurance

Comparative Study of Automated Testing Tools: TestComplete and QuickTest Pro

Testing. Chapter. A Fresh Graduate s Guide to Software Development Tools and Technologies. CHAPTER AUTHORS Michael Atmadja Zhang Shuai Richard

STUDY AND ANALYSIS OF AUTOMATION TESTING TECHNIQUES

Data Driven Automation Testing Framework

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

Test Automation Framework

Test Automation Integration with Test Management QAComplete

Zoomer: An Automated Web Application Change Localization Tool

A Scheme for Automation of Telecom Data Processing for Business Application

QA Tools (QTP, QC/ALM), ETL Testing, Selenium, Mobile, Unix, SQL, SOAP UI

Pipeline Orchestration for Test Automation using Extended Buildbot Architecture

Selenium Open Source Test Automation Framework FAQ

Online Auction Software Fundamentals

QA Tools (QTP, QC/ALM), Selenium with Java, Mobile with Automation, Unix, SQL, SOAP UI

Introduction to Selenium Using Java Language

Higher Focus on Quality. Pressure on Testing Budgets. ? Short Release Cycles. Your key to Effortless Automation. OpKey TM

Automation using Selenium

COURSE CONTENT FOR WINTER TRAINING ON Web Development using PHP & MySql

A Platform Independent Testing Tool for Automated Testing of Web Applications

Software Automated Testing

Comparative Study of Automated Web Testing Tools

Visualisation in the Google Cloud

Client Side Filter Enhancement using Web Proxy

Latest Trends in Testing. Ajay K Chhokra

TESTING FRAMEWORKS. Gayatri Ghanakota

A MODEL FOR PERFORMANCE TESTING OF AJAX BASED WEB APPLICATIONS

Visualization of Semantic Windows with SciDB Integration

Comparative Study of Automated Testing Tools: Selenium, Quick Test Professional and Testcomplete

Appium mobile test automation

International Journal of Engineering Technology, Management and Applied Sciences. November 2014, Volume 2 Issue 6, ISSN

Web Development using PHP (WD_PHP) Duration 1.5 months

Automating Testing and Configuration Data Migration in OTM/GTM Projects using Open Source Tools By Rakesh Raveendran Oracle Consulting

A Framework of Model-Driven Web Application Testing

Case Studies of Running the Platform. NetBeans UML Servlet JSP GlassFish EJB

QTP Open Source Test Automation Framework Introduction

An Implementation of Software Project Scheduling and Planning using ACO & EBS

Cache Database: Introduction to a New Generation Database

Web based Automation Testing and Tools

Generating Automated Test Scripts for AltioLive using QF Test

Regression model approach to predict missing values in the Excel sheet databases

Basic Unix/Linux 1. Software Testing Interview Prep

International Journal of Advanced Engineering Research and Science (IJAERS) Vol-2, Issue-11, Nov- 2015] ISSN:

Load Testing Ajax Apps using head-less browser tools. NoVaTAIG April 13, 2011 Gopal Addada and Frank Hurley Cigital Inc.

SUBJECT CODE : 4074 PERIODS/WEEK : 4 PERIODS/ SEMESTER : 72 CREDIT : 4 TIME SCHEDULE UNIT TOPIC PERIODS 1. INTERNET FUNDAMENTALS & HTML Test 1

a new generation software test automation framework - CIVIM

How To Create A Data Transformation And Data Visualization Tool In Java (Xslt) (Programming) (Data Visualization) (Business Process) (Code) (Powerpoint) (Scripting) (Xsv) (Mapper) (

Benefits of Test Automation for Agile Testing

Visualization in Argument Based Recommender System

Design Approaches of Web Application with Efficient Performance in JAVA

Keywords: Bug, Bug report, Bug tracking, Bug tracking tools.

Improvised Software Testing Tool

QUICK START GUIDE. Cloud based Web Load, Stress and Functional Testing

VOL. 2, NO. 1, January 2012 ISSN ARPN Journal of Science and Technology ARPN Journals. All rights reserved

Software Quality Testing Course Material

How To Understand The Architecture Of Java 2Ee, J2Ee, And J2E (Java) In A Wordpress Blog Post

Enhancing Effectiveness of WATIR through Keyword Driven Framework

Automated Model Based Testing for an Web Applications

Reusability of WSDL Services in Web Applications

Indirect Positive and Negative Association Rules in Web Usage Mining

Certified Selenium Professional VS-1083

Data Domain Profiling and Data Masking for Hadoop

WEB TESTING APPLICATION WITH PHP AUTOMATED TOOL

Testhouse Training Portfolio

WEB APPLICATION TESTING SOLUTIONS WITH SELENIUM

Adopting Keyword-driven Testing Framework into Jenkins Continuous Integration Tool: iproperty Group Case Study

C2C: An Automated Deployment Framework for Distributed Applications on Multi-Clouds

Systems must meet the following requirements when using the Matrix WebConnect service: Average Network Bandwidth Utilization

CSc 230 Software System Engineering FINAL REPORT. Project Management System. Prof.: Doan Nguyen. Submitted By: Parita Shah Ajinkya Ladkhedkar

}w!"#$%&'()+,-./012345<ya

Know the Difference. Unified Functional Testing (UFT) and Lean Functional Testing (LeanFT) from HP

Tavant Technologies. Flexible Approach to Test Automation with Measureable ROI. White Paper. Madan Mohan Reddy B Santosh Kumar CH

OpenReports: Users Guide

IBM Operational Decision Manager Version 8 Release 5. Getting Started with Business Rules

LISTSERV LDAP Documentation

A framework for Itinerary Personalization in Cultural Tourism of Smart Cities

Perfect Your Mobile App with Load Testing and Test Automation

Efficient Agent Based Testing Framework for Web Applications

data.bris: collecting and organising repository metadata, an institutional case study

The goal with this tutorial is to show how to implement and use the Selenium testing framework.

WebFOCUS Reporting User Manual

Graduate Student Database Project

The Research and Implementation of the Key Techniques on Post-graduate Degree-granting Online Information Collection System

Transcription:

Data Driven Testing Framework using Selenium WebDriver Chandraprabha Research Scholar SRMSCET, Bareilly Ajeet Kumar Assistant Professor SRMSCET, Bareilly Sajal Saxena Technology Analyst Pune, India ABSTRACT Software Development Life Cycle is having various phases, among them software testing is a phase which is an ongoing process just start after the requirement gathering phase. Software testing have to face various challenges. Even though manual testing is an easy task but it is very time consuming and labor intensive process. Automation Testing is the solution of all the problems which are faced during manual testing. The aim of this research paper is to perform automation testing using Selenium WebDriver. With Selenium WebDriver I have developed data driven framework which means separating data to code for reusability purpose. In this framework we abstracted the data which would be used in excel file and the program is written to access data from that excel files. Keywords Software Testing, Automation Testing, Selenium WebDriver, Framework, Data Driven Framework 1. INTRODUCTION Software testing is the very important phase of software development life cycle process almost 30-40% of total project s effort is invested in testing. The American novelist and historian Edward Eggleston wrote that persistent people begin their success where others end in failure. In software testing persistence is essential. Software testing is done to discover the errors not to conceal them. As web applications are becoming more complexhence testing process is also becoming complex and important, a professor from university of California William How den wrote that testing is the unavoidable part of any responsible effort to develop a software system. Software testing can be done either manually or using any tool. As manual testing is labor intensive and time consuming process hence using an automated tool for software testing is a good solution. Selenium is an open source testing tool which isused to automate the test cases and enhance the testing performance. Selenium is an automated testing tool for web application. As web is growing testing of such web applications are becoming too more complicated. Testers have to face various challenges while testing such complicated web applications like multiplebrowser support, multiple platform support, handling wait conditions, handling flash objects, multiple language support etc. Selenium WebDriver ensure the tester to handle all such challenges. Selenium WebDriver basically work in two ways first locate the element and then perform some action on them. Selenium WebDriver locate element by usingid, name,xpath, CSS, link text, partial link text. Selenium provides a rich set of functions which is used to testing of a web application. 2. PROPOSED WORK In this paper we will explain about how we can design and use data driven automation framework in Selenium WebDriver using Java. Here with selenium WebDriver we will use TestNG unit testing framework. TestNG provides rich set of annotations and also able to generate reports.while testing an application several times it is required to test the same functionality with the different set of input data. In such scenario test data should not be embedded with test script for reusability purpose. Data is stored in some external files. External file may be xml, excel, database and csv. The test script is first connected with the external data source and then extract the data from that source. The benefit of this framework is that when we have to do the functionality testing with different dataset then we don t need to change our code. We have just to give the path of that data source which reduces our time and effort both. \ 18

AUT ANT Selenium WebDriver TestNG Automated Test Scripts (.java) POI Test Data Files (.xls) Automated TestResults (.html) Fig1Selenium Data Driven Architecture In the above architecture(fig 1) WebDriver interact with the AUT (application under test) which we have to test and first locate the elements which we have to test and then perform the operations. Here TestNG unit testing framework is used and also the benefit of TestNGwith ANT is that it is able to generate HTML reports which could not be generated using WebDriver. Ant is a build tool which is able to generate HTML reports.automated test scripts are written in java. Data is accessed from the excel file. To access the data from excel file Apache POI is used. Apache POI is a project by Apache foundation which provides pure java libraries for reading and writing files in Microsoft Office formats. POI contains several sub components but here we are using only HSSF and XSSF. HSSF stands for HorribleSpreadsheet Format which reads and writesmicrosoft Excel format files. XSSF stands for XML spreadsheet format which is used to read and write Office Open XML format files 3. EXPERIMENTAL RESULTS. Data Driven framework works in two steps- Step 1: The first step of data driven framework is to create an external file which stores the test data. Test data could be stored in Excel file, Xml file, Data base and CSV. In our project we are storing data in Excel file for user login. Fig 2: Login Data Step 2:Second step of data driven framework is to populate the data into automation test script. This step could be understand by following sub steps: First we have to import all the required packages, second sub step is to declare a class third and most important sub step is to create a method which will read the data from excel and last sub step is make a user define function which will convert cell data into string and after this we can use this data for login purpose. 19

Fig 3: Logging into Gmail account Script Here in fig 2 we are accessing Email id and password from the excel file which is stored in our machine at location E:\\Selenium_Projects\\testData.xls. Here we are using String [][] gmaildata = ReadDataFrmXL.readData("E:\\Selenium_Projects\\testData. xls",0); Here we are using two dimensional array of string type for storing userid and password. We are using readdata() method of ReadFmXL file by giving the location of our testdatafilepath and sheet no. We have created a class ReadDataFrmXLwhich is reading the data from excel file and we are extending another class LaunchCloseBrowser where the basic method of Selenium WebDriver is written which include opening the browser maximizing it and path of browserdriver. public class ReadDataFrmXL { static intxrows; static intxcols; public static String[][] readdata(string fpath, intsheetnum) throws Exception{ File file = new File(fPath); FileInputStreamfIP = new FileInputStream(file); HSSFWorkbookwb = new HSSFWorkbook(fIP); HSSFSheet sheet = wb.getsheetat(sheetnum); xrows = sheet.getlastrownum()+1; System.out.println("Rows are :"+ xrows); xcols = sheet.getrow(0).getlastcellnum(); 20

System.out.println("Columns are : " + xcols); String[][] xdata = new String[xRows][xCols]; for(inti=0; i<xrows; i++){ HSSFRow row = sheet.getrow(i); for(int j=0; j<xcols; j++){ HSSFCell cell = row.getcell(j); String value= CellToString(cell); xdata[i][j] = value; System.out.println(value); //System.out.print("##"); //System.out.println("@"); return xdata; Here apache POI will return cell type object which we have to convert into string using following: public static String CellToString(HSSFCell cell) { int type = cell.getcelltype(); Object result = null; switch(type){ case HSSFCell.CELL_TYPE_BLANK: result = ""; //System.out.println("Blank Value"); case HSSFCell.CELL_TYPE_BOOLEAN: result = cell.getbooleancellvalue(); //System.out.println(result); case HSSFCell.CELL_TYPE_ERROR: //System.out.println("There is some error."); throw new RuntimeException("Error"); case HSSFCell.CELL_TYPE_FORMULA: throw new RuntimeException("Formula can not be eveluated."); case HSSFCell.CELL_TYPE_NUMERIC: result = cell.getnumericcellvalue(); //System.out.println(result); case HSSFCell.CELL_TYPE_STRING: System.out.println(result); result = cell.getstringcellvalue(); default: System.out.println("Out of world."); //System.out.println(result); 21

throw new RuntimeException("Out of world."); return result.tostring(); Fig 4: Logging into Gmail account 4. DATA DRIVEN FRAMEWORK ADVANTAGES The most important feature of this framework is that it provide the reusability and reduces the total number of scripts required to cover all the possible combinations of test scenarios. Hence we can cover the complete set of test scenarios in lesser amount of code. Second benefit of this framework is that if any change is done in test data matrix it will not affect the test script code. A single test scenario can be executed for different test data values. 5. CONCLUSION Meaning of automation is not just to automate the test cases using the tool even it is much more. While automating a web application various challenges may be faced by the tester as now a days web application has become more complex and feature rich. Selection of a good framework is also a problem while automating an application. In this paper we have created data driven framework to perform Automation testing forweb application using Selenium WebDriver. Here we are using excel files to access the data. Here we will use TestNG unit testing framework to generate the reports. Data Driven framework is a good solution while we are having a big data set and it is time saving and effort saving solution. Future work will use data driven framework with keyword driven framework to develop the domain specific - requirement basedknowledge repository. Knowledge repository contains domain specific keywords that will help in faster execution of the keywords and save lot of time and project budget. 6. REFERENCES [1] Innovative approaches of automated tools in software testing and current technology as compared to manual testing, Global journal of enterprise of information system, January 2009-june 2009. [2] Alex Cervantes, Exploring the Use of a Test Automation Framework, IEEEAC paper #1477, version 2, up dated January 9, 2009. [3] Khaled Mustafa, Rafa E. Al-Qutaish, Mohammad I. Muhairat, Cassification of Software testing Tools Based on the Software Testing Methods, 2009 second International Conference on Computer and Electrical Engineering, 978-0-7695-3925-6, 2009. [4] Harpreet Kaur, Dr.Gagan Gupta, Comparative Study of Automated Testing Tools: Selenium, Quick Test Professional and Testcomplete. [5] R.S.Pressman, Software Engineering A Practitioner s Approach, Mcgraw-Hill International Edition, ISBN 007-124083-7. [6] Harpreet Kaur and Sherry Singla Selenium Keyword Driven Automation Testing framework in International Journal of Advanced Research in Computer Science and Software Engineering. 22

[7] Rashmi, Neha Bajpai a Keyword Driven Framework for Testing Web Application in International Journal of Advanced Computer Science and Applications, Vol. 3, No. 3, 2012. [8] Razak R.A and Fahrurazi presentea a paper Agile Testing with Selenium IEEE explorer digital library December 2011. [9] Nidhika Uppal and Vinay Chopra Design and Implementation in Selenium IDE with WebDriver in International Journal of Computer Applications May 2012. [10] Nidhika Uppal and Vinay Chopra Enhancement and Elimination of Roadblocks in Automation Testing Tool Selenium RC in September 2012. [11] Laukkanen, Pekka, Data-Driven and Keyword-Driven Test Automation Frameworks, Master s Thesis, Software Business and Engineering Institute, Department of Computer Science and Engineering, Helsinki University of Technology, 2006. [12] Pettichord, Seven steps to test automation success in Proceedings of the Software Testing, Analysis & Review Conference (STAR), 1999. [13] G. A. Di Lucca, A. Fasolino, F. Faralli, and U. D. Carlini. Testing web applications in International Conference on Software Maintenance, 2002. [14] B. Posey and Mosley, Just Enough Software Test Automation, Prentice Hall PTR, 2002. IJCA TM : www.ijcaonline.org 23